Skip to content

Commit

Permalink
IA-3039 Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
bramj committed May 30, 2024
1 parent 02f7ff1 commit 5b42759
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions iaso/tests/api/test_entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -792,12 +792,16 @@ def test_retrieve_entities_user_geo_restrictions(self):
entity_type = EntityType.objects.create(name="Type 1", reference_form=self.form_1, account=self.star_wars)

# Village 1 (district 1): instance + entity
instance = Instance.objects.create(org_unit=village_1, form=self.form_1, period="202002")
Entity.objects.create(entity_type=entity_type, attributes=instance, account=self.star_wars)
instance_1 = Instance.objects.create(org_unit=village_1, form=self.form_1, period="202002")
entity = Entity.objects.create(entity_type=entity_type, attributes=instance_1, account=self.star_wars)
instance_1.entity = entity
instance_1.save()

# Village 2 (district 2): instance + entity
second_instance = Instance.objects.create(org_unit=village_2, form=self.form_1, period="202002")
Entity.objects.create(entity_type=entity_type, attributes=second_instance, account=self.star_wars)
instance_2 = Instance.objects.create(org_unit=village_2, form=self.form_1, period="202002")
entity_2 = Entity.objects.create(entity_type=entity_type, attributes=instance_2, account=self.star_wars)
instance_2.entity = entity_2
instance_2.save()

response = self.client.get("/api/entities/", format="json")

Expand Down

0 comments on commit 5b42759

Please sign in to comment.