mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-31 06:52:06 -05:00
Don’t wipe domains when updating other attributes
The domains for an organisation should only be updated (or wiped) if a new list is explicitly passed in by the admin app.
This commit is contained in:
@@ -201,6 +201,29 @@ def test_post_update_organisation_updates_domains(
|
||||
] == domain_list
|
||||
|
||||
|
||||
def test_update_other_organisation_attributes_doesnt_clear_domains(
|
||||
admin_request,
|
||||
notify_db_session,
|
||||
):
|
||||
org = create_organisation(name='test_org_2')
|
||||
create_domain('example.gov.uk', org.id)
|
||||
|
||||
admin_request.post(
|
||||
'organisation.update_organisation',
|
||||
_data={
|
||||
'agreement_signed': True,
|
||||
},
|
||||
organisation_id=org.id,
|
||||
_expected_status=204
|
||||
)
|
||||
|
||||
assert [
|
||||
domain.domain for domain in org.domains
|
||||
] == [
|
||||
'example.gov.uk'
|
||||
]
|
||||
|
||||
|
||||
def test_post_update_organisation_raises_400_on_existing_org_name(
|
||||
admin_request, sample_organisation):
|
||||
org = create_organisation()
|
||||
|
||||
Reference in New Issue
Block a user