Esempio n. 1
0
 def test_cross_domain_both_clean(self):
     new_domain = uuid.uuid4().hex
     self.factory.domain = new_domain
     self.factory.create_or_update_case(
         CaseStructure(
             indices=[
                 CaseIndex(),
             ]
         )
     )
     # two clean ownership models in different domains should report clean
     self.assertTrue(get_cleanliness_flag_from_scratch(self.domain, self.owner_id).is_clean)
     self.assertTrue(get_cleanliness_flag_from_scratch(new_domain, self.owner_id).is_clean)
Esempio n. 2
0
 def test_cross_domain_both_clean(self):
     new_domain = uuid.uuid4().hex
     self.factory.domain = new_domain
     self.factory.create_or_update_case(
         CaseStructure(
             relationships=[
                 CaseRelationship(),
             ]
         )
     )
     # two clean ownership models in different domains should report clean
     self.assertTrue(get_cleanliness_flag_from_scratch(self.domain, self.owner_id).is_clean)
     self.assertTrue(get_cleanliness_flag_from_scratch(new_domain, self.owner_id).is_clean)
Esempio n. 3
0
 def test_cross_domain_dirty(self):
     new_domain = uuid.uuid4().hex
     new_owner = uuid.uuid4().hex
     self.factory.domain = new_domain
     self.factory.create_or_update_case(
         CaseStructure(
             indices=[
                 CaseIndex(CaseStructure(attrs={'owner_id': new_owner})),
             ]
         )
     )
     # original domain should stay clean but the new one should be dirty
     self.assertTrue(get_cleanliness_flag_from_scratch(self.domain, self.owner_id).is_clean)
     self.assertFalse(get_cleanliness_flag_from_scratch(new_domain, self.owner_id).is_clean)
Esempio n. 4
0
 def test_cross_domain_dirty(self):
     new_domain = uuid.uuid4().hex
     new_owner = uuid.uuid4().hex
     self.factory.domain = new_domain
     self.factory.create_or_update_case(
         CaseStructure(
             relationships=[
                 CaseRelationship(CaseStructure(attrs={'owner_id': new_owner})),
             ]
         )
     )
     # original domain should stay clean but the new one should be dirty
     self.assertTrue(get_cleanliness_flag_from_scratch(self.domain, self.owner_id).is_clean)
     self.assertFalse(get_cleanliness_flag_from_scratch(new_domain, self.owner_id).is_clean)
Esempio n. 5
0
 def test_non_existent_parent(self):
     self.factory.create_or_update_case(
         CaseStructure(
             indices=[
                 CaseIndex(CaseStructure()),
             ],
             walk_related=False,
         )
     )
     self.assertTrue(get_cleanliness_flag_from_scratch(self.domain, self.owner_id).is_clean)
Esempio n. 6
0
 def test_non_existent_parent(self):
     self.factory.create_or_update_case(
         CaseStructure(
             indices=[
                 CaseIndex(CaseStructure()),
             ],
             walk_related=False,
         )
     )
     self.assertTrue(get_cleanliness_flag_from_scratch(self.domain, self.owner_id).is_clean)