Esempio n. 1
0
    def test_find_contact_by_number(self):
        """ 
      Test find_contact by number method that is meant to return a
      contact when given a number.
    """

        self.new_contact.save_contact()

        self.added_contact = Contact("Ethan", "Hunt", "0786474",
                                     "*****@*****.**")

        self.added_contact.save_contact()

        found_contact = Contact.find_by_number("0786474")
        """  
      Since we know that add_contact number is 0786474 with email
      [email protected], found contact method should return the same email.
    """
        self.assertEqual(found_contact.email, self.added_contact.email)
Esempio n. 2
0
def find(number):
    """  
    Function that find a contact by number and returns the contact
  """
    return Contact.find_by_number(number)