def test_find_contact_by_number(self): self.new_contact.save_contact() test_contact = Contact("Test", "user", "0712345678", "*****@*****.**") # new contact test_contact.save_contact() found_contact = Contact.find_by_number("0712345678") self.assertEqual(found_contact.email, test_contact.email)
def find_contact(number): return Contact.find_by_number(number)