From 6221b0abcdf715169cf8ec5ea2584a74bf63e4cb Mon Sep 17 00:00:00 2001
From: Paulina Kujawa
Date: Thu, 19 Dec 2024 13:06:45 +0100
Subject: [PATCH] fix more tests
---
tests/unit/apps/registration_datahub/test_rdi_merge.py | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/tests/unit/apps/registration_datahub/test_rdi_merge.py b/tests/unit/apps/registration_datahub/test_rdi_merge.py
index a58c99baed..739d295675 100644
--- a/tests/unit/apps/registration_datahub/test_rdi_merge.py
+++ b/tests/unit/apps/registration_datahub/test_rdi_merge.py
@@ -447,6 +447,7 @@ def test_merge_rdi_create_collections(self, household_representation_exists: boo
if False, another household representation exists, but it does not have collection,
if None, household representation does not exist in another program
"""
+ program_2 = ProgramFactory(business_area=self.rdi.business_area)
self.rdi.data_source = RegistrationDataImport.PROGRAM_POPULATION
self.rdi.save()
imported_household = HouseholdFactory(
@@ -454,11 +455,13 @@ def test_merge_rdi_create_collections(self, household_representation_exists: boo
registration_data_import=self.rdi,
unicef_id="HH-9",
rdi_merge_status=MergeStatusModel.PENDING,
+ program=self.rdi.program,
)
self.set_imported_individuals(imported_household)
individual_without_collection = IndividualFactory(
unicef_id="IND-9",
business_area=self.rdi.business_area,
+ program=program_2,
household=None,
)
individual_without_collection.individual_collection = None
@@ -468,6 +471,7 @@ def test_merge_rdi_create_collections(self, household_representation_exists: boo
IndividualFactory(
unicef_id="IND-8",
business_area=self.rdi.business_area,
+ program=program_2,
individual_collection=individual_collection,
household=None,
)
@@ -477,6 +481,7 @@ def test_merge_rdi_create_collections(self, household_representation_exists: boo
household = HouseholdFactory(
head_of_household=individual_without_collection,
business_area=self.rdi.business_area,
+ program=program_2,
unicef_id="HH-9",
)
household.household_collection = None