def update_contact(runnable): tree_position = getattr(runnable, 'tree_position', Flow.Label.IMPLEMENTING_PARTNER) ContactService.update_after_delivery_creation(runnable.contact_person_id, tree_position, runnable.programme.name, runnable.location, runnable.consignee.name)
def test_should_not_update_contact_when_contact_not_modified(self, update, get): get.return_value = CONTACT update.return_value = 200 ContactService.update_after_delivery_creation(CONTACT['_id'], type='End-user', outcome='YI105 - PCR 1 KEEP CHILDREN AND MOTHERS', ip='WAKISO DHA', district='Wakiso') ContactService.get.assert_called_once_with(CONTACT['_id']) ContactService.update.assert_not_called(CONTACT)