remove two xfails

This commit is contained in:
Kenneth Kehl
2023-05-25 10:24:49 -07:00
parent 255faf3eb0
commit 22f714f8fa
2 changed files with 27 additions and 9 deletions

View File

@@ -90,10 +90,6 @@ def test_update_organisation(notify_db_session):
(['ABC', 'DEF'], {'abc', 'def'}), (['ABC', 'DEF'], {'abc', 'def'}),
([], set()), ([], set()),
(None, {'123', '456'}), (None, {'123', '456'}),
pytest.param(
['abc', 'ABC'], {'abc'},
marks=pytest.mark.xfail(raises=IntegrityError)
),
)) ))
def test_update_organisation_domains_lowercases( def test_update_organisation_domains_lowercases(
notify_db_session, notify_db_session,
@@ -113,6 +109,29 @@ def test_update_organisation_domains_lowercases(
assert {domain.domain for domain in organisation.domains} == expected_domains assert {domain.domain for domain in organisation.domains} == expected_domains
@pytest.mark.parametrize('domain_list, expected_domains', (
(['abc', 'ABC'], {'abc'}),
))
def test_update_organisation_domains_lowercases_integrity_error(
notify_db_session,
domain_list,
expected_domains,
):
create_organisation()
organisation = Organisation.query.one()
# Seed some domains
dao_update_organisation(organisation.id, domains=['123', '456'])
with pytest.raises(expected_exception=IntegrityError):
# This should overwrite the seeded domains
dao_update_organisation(organisation.id, domains=domain_list)
assert {domain.domain for domain in organisation.domains} == expected_domains
def test_update_organisation_does_not_update_the_service_if_certain_attributes_not_provided( def test_update_organisation_does_not_update_the_service_if_certain_attributes_not_provided(
sample_service, sample_service,
sample_organisation, sample_organisation,

View File

@@ -127,10 +127,7 @@ def test_get_organisation_by_id_returns_domains(admin_request, notify_db_session
('foo.gov.uk', 200), ('foo.gov.uk', 200),
('bar.gov.uk', 200), ('bar.gov.uk', 200),
('oof.gov.uk', 404), ('oof.gov.uk', 404),
pytest.param( ('rab.gov.uk', 200),
'rab.gov.uk', 200,
marks=pytest.mark.xfail(raises=AssertionError),
),
(None, 400), (None, 400),
('personally.identifying.information@example.com', 400), ('personally.identifying.information@example.com', 400),
)) ))
@@ -152,7 +149,9 @@ def test_get_organisation_by_domain(
domain=domain, domain=domain,
) )
if expected_status == 200: if domain == 'rab.gov.uk' and expected_status == 200:
assert response['id'] == str(other_org.id)
elif expected_status == 200:
assert response['id'] == str(org.id) assert response['id'] == str(org.id)
else: else:
assert response['result'] == 'error' assert response['result'] == 'error'