def test_updating_a_contact(self): contact1 = Contact("p1",123,"[email protected]").save() contact = Contact.find_by_name("p1") contact.update(**{'name': "pp1"}) self.assertEqual(Contact.find_by_name("pp1").phone_number, 123)
def test_find_a_contact_by_name(self): contact1 = Contact("p1",123,"[email protected]").save() contact2 = Contact("p2",124,"[email protected]").save() contact = Contact.find_by_name("p2") self.assertEqual(contact.name, contact2.name)