コード例 #1
0
ファイル: handlers.py プロジェクト: unicefuganda/eums
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)
コード例 #2
0
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)
コード例 #3
0
    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)
コード例 #4
0
ファイル: test_contact_service.py プロジェクト: mac119/eums
    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)