Skip to content

Commit

Permalink
Update destinations bdd test to have multiple end_users
Browse files Browse the repository at this point in the history
  • Loading branch information
saruniitr committed Dec 11, 2024
1 parent 3826af7 commit 0be867d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
15 changes: 15 additions & 0 deletions api/data_workspace/v2/tests/bdd/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
from api.applications.tests.factories import (
DraftStandardApplicationFactory,
GoodOnApplicationFactory,
EndUserFactory,
PartyOnApplicationFactory,
StandardApplicationFactory,
)
Expand Down Expand Up @@ -440,6 +441,20 @@ def add_end_user_to_application(draft_standard_application, country):
end_user.party.save()


@given(parsers.parse("a new end-user added to the application of `{country}`"))
def add_new_end_user_to_application(draft_standard_application, country):
country = Country.objects.get(name=country)
end_user = PartyOnApplicationFactory(
application=draft_standard_application,
party=EndUserFactory(country=country, organisation=draft_standard_application.organisation),
)
PartyDocumentFactory(
party=end_user.party,
s3_key="party-document-second",
safe=True,
)


@when(
"the application is submitted",
target_fixture="submitted_standard_application",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ Scenario: Check that the country code and type are included in the extract
| id | 03fb08eb-1564-4b68-9336-3ca8906543f9 |
And a consignee added to the application in `Australia`
And an end-user added to the application of `New Zealand`
And a new end-user added to the application of `South Korea`
When the application is submitted
And the application is issued at 2024-11-22T13:35:15
Then the `destinations` table has the following rows:
| application_id | country_code | type |
| 03fb08eb-1564-4b68-9336-3ca8906543f9 | KR | end_user |
| 03fb08eb-1564-4b68-9336-3ca8906543f9 | NZ | end_user |
| 03fb08eb-1564-4b68-9336-3ca8906543f9 | AU | consignee |

Expand Down

0 comments on commit 0be867d

Please sign in to comment.