mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-18 21:48:49 -04:00
Choose most specific domains first
If we had organisations for GDS and Cabinet Office, then we’d always want someone whose email address ends in `@cabinet-office.gov.uk` to match to `cabinet-office.gov.uk` before matching to `digital.cabinet-office.gov.uk`. Sorting the list by shortest first addresses this.
This commit is contained in:
@@ -271,6 +271,10 @@ def test_create_service_with_domain_sets_organisation(
|
||||
expected_org,
|
||||
):
|
||||
|
||||
red_herring_org = create_organisation(name='Sub example')
|
||||
create_domain('specific.example.gov.uk', red_herring_org.id)
|
||||
create_domain('aaaaaaaa.example.gov.uk', red_herring_org.id)
|
||||
|
||||
org = create_organisation()
|
||||
create_domain('example.gov.uk', org.id)
|
||||
create_domain('test.gov.uk', org.id)
|
||||
|
||||
Reference in New Issue
Block a user