def test_delete(self): contact = MyContact(email="*****@*****.**") contact.save() time.sleep(10) icontact = self.observer.get_contact(contact) contact_id = icontact['contact']['contactId'] contact.delete() client = self.observer.client() contact = client.get_contact(contact_id) self.assertEqual('deleted', contact['contact']['status'])
def test_update(self): contact = MyContact(email="*****@*****.**") contact.save() contact.first_name = 'victor' contact.save() #should call the update method on the observer model contact = self.observer.get_contact(contact) contact_first_name = contact['contact']['firstName'] self.assertEqual('victor', contact_first_name)
def test_create(self): contact = MyContact(email="*****@*****.**") contact.save() local_icontacts = IContact.objects.all() self.assertTrue(local_icontacts)
def test_get_contact(self): contact = MyContact(email="*****@*****.**") contact.save() contact = self.observer.get_contact(contact) self.assertTrue(contact)