Skip to content

Commit

Permalink
Add test for draft licences and draft applications
Browse files Browse the repository at this point in the history
  • Loading branch information
hnryjmes committed Nov 28, 2024
1 parent cb1c1e2 commit 807d0a0
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,21 @@ Scenario: NLR goods not on licence
Then the `goods_on_licences` table has the following rows:
| good_id | licence_id |
| aa9736f9-48f5-4d44-ace9-e4b8738591a5 | 847a9a03-c35f-4036-ab8c-8b58d13482ab |

Scenario: Draft licences
Given a standard application with the following goods:
| id | name |
| f7c674b1-cd5e-4a6d-a1f5-d6ab58149d05 | A controlled good 2 |
And a draft licence with attributes:
| name | value |
| id | 297e89b9-fc93-4f38-be46-c2ab38914007 |
Then the `goods_on_licences` table is empty

Scenario: Draft applications
Given a draft standard application with the following goods:
| id | name |
| 8262dcf7-d932-4a33-978d-b5aa8a7878ee | A controlled good 3 |
And a draft licence with attributes:
| name | value |
| id | 2078827b-6d67-406c-becc-41c423720cfc |
Then the `goods_on_licences` table is empty
15 changes: 15 additions & 0 deletions api/data_workspace/v2/tests/bdd/test_goods_on_licences.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,18 @@ def the_goods_are_assessed_by_tau_as(
**gov_headers,
)
assert response.status_code == 200, response.content


@given(
parsers.parse("a draft standard application with the following goods:{goods}"), target_fixture="draft_application"
)
def draft_standard_application_with_following_goods(parse_table, goods, draft_application):
draft_application.goods.all().delete()
good_attributes = parse_table(goods)[1:]
for id, name in good_attributes:
GoodOnApplicationFactory(
application=draft_application,
id=id,
good__name=name,
)
return draft_application

0 comments on commit 807d0a0

Please sign in to comment.