Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #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)