Example #1
0
    def test_update_or_create_from_temba(self):
        temba_contact = TembaContact.create(uuid='C-006', name="Jan", urns=['tel:123'],
                                            groups=['G-001', 'G-007'],
                                            fields={'registration_date': None, 'state': None,
                                                    'lga': None, 'occupation': None, 'born': None,
                                                    'gender': None},
                                            language='eng')

        contact = Contact.update_or_create_from_temba(self.nigeria, temba_contact)

        self.assertEqual(contact.uuid, 'C-006')

        updated_contact = Contact.update_or_create_from_temba(self.nigeria, temba_contact)

        self.assertEqual(contact.pk, updated_contact.pk)
Example #2
0
    def test_update_or_create_from_temba(self):
        temba_contact = TembaContact.create(uuid='C-006',
                                            name="Jan",
                                            urns=['tel:123'],
                                            groups=['G-001', 'G-007'],
                                            fields={
                                                'registration_date': None,
                                                'state': None,
                                                'lga': None,
                                                'occupation': None,
                                                'born': None,
                                                'gender': None
                                            },
                                            language='eng')

        contact = Contact.update_or_create_from_temba(self.nigeria,
                                                      temba_contact)

        self.assertEqual(contact.uuid, 'C-006')

        updated_contact = Contact.update_or_create_from_temba(
            self.nigeria, temba_contact)

        self.assertEqual(contact.pk, updated_contact.pk)