class TestTreatmentOutcomeRepeater(ENikshayLocationStructureMixin, ENikshayRepeaterTestBase): def setUp(self): super(TestTreatmentOutcomeRepeater, self).setUp() self.repeater = NinetyNineDotsTreatmentOutcomeRepeater( domain=self.domain, url='case-repeater-url', ) self.repeater.white_listed_case_types = ['episode'] self.repeater.save() def test_trigger(self): self.create_case_structure() self._create_99dots_registered_case() self._create_99dots_enabled_case() self.assign_person_to_location(self.phi.location_id) self.assertEqual(0, len(self.repeat_records().all())) self._update_case(self.episode_id, {TREATMENT_OUTCOME: 'the_end_of_days'}) self.assertEqual(1, len(self.repeat_records().all())) self._update_case(self.episode_id, {TREATMENT_SUPPORTER_FIRST_NAME: 'boo'}) self.assertEqual(1, len(self.repeat_records().all()))
def setUp(self): super(TestTreatmentOutcomeRepeater, self).setUp() self.repeater = NinetyNineDotsTreatmentOutcomeRepeater( domain=self.domain, url='case-repeater-url', ) self.repeater.white_listed_case_types = ['episode'] self.repeater.save()