Skip to content

Commit

Permalink
add site factory to new assessment tests - these were passing individ…
Browse files Browse the repository at this point in the history
…ually but not when run as a batch
  • Loading branch information
eatyourpeas committed Jan 19, 2025
1 parent 96b03f2 commit 9075d9e
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions epilepsy12/tests/model_tests/test_assessment.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,14 @@ def test_allocate_general_paediatric_centre_to_case_same_organisation_as_lead(

ADDENBROOKES = Organisation.objects.get(ods_code="RGT01") # Addenbrookes

site = e12_site_factory(
organisation=ADDENBROOKES,
case=case,
site_is_primary_centre_of_epilepsy_care=True,
site_is_actively_involved_in_epilepsy_care=True,
site_is_general_paediatric_centre=False,
)

# create a case object
assessment = case.registration.assessment

Expand All @@ -347,6 +355,12 @@ def test_allocate_general_paediatric_centre_to_case_same_organisation_as_lead(
case=case,
)

# ensure the site associated with the case is not a general paediatric centre
assert site.organisation == ADDENBROOKES
assert site.site_is_primary_centre_of_epilepsy_care is True
assert site.site_is_actively_involved_in_epilepsy_care is True
assert site.site_is_general_paediatric_centre is False

# update the site model
update_site_model(
centre_role="general_paediatric_centre",
Expand Down Expand Up @@ -397,6 +411,14 @@ def test_allocate_general_paediatric_centre_to_case_different_organisation_as_le

ADDENBROOKES = Organisation.objects.get(ods_code="RGT01") # Addenbrookes

site = e12_site_factory(
organisation=ADDENBROOKES,
case=case,
site_is_primary_centre_of_epilepsy_care=True,
site_is_actively_involved_in_epilepsy_care=True,
site_is_general_paediatric_centre=False,
)

# create a case object
assessment = case.registration.assessment

Expand Down

0 comments on commit 9075d9e

Please sign in to comment.