def test_print_contact(self): data = { "id_type": "CC", "id_number": "1000000", "id_exp_date": date(2001, 1, 11), "full_name": "John Doe", "email": "*****@*****.**", "phone_number": "1234567890" } contact = Contact(**data) expected_result = (f"id_type: {contact.id_type}\n" + f"id_number: {contact.id_number}\n" + f"id_exp_date: {contact.id_exp_date}\n" + f"full_name: {contact.full_name}\n" + f"email: {contact.email}\n" + f"phone_number: {contact.phone_number}") self.assertEqual(contact.__str__(), expected_result)
def test_create_contact(self): data = { "id_type": "CC", "id_number": "1000000", "id_exp_date": date(2001, 1, 11), "full_name": "John Doe", "email": "*****@*****.**", "phone_number": "1234567890" } contact = Contact(**data) self.assertIsInstance(contact, Contact) self.assertEqual(contact.id_type, data["id_type"]) self.assertEqual(contact.id_number, data["id_number"]) self.assertEqual(contact.id_exp_date, data["id_exp_date"].strftime(Person.DATE_FORMAT)) self.assertEqual(contact.full_name, data["full_name"]) self.assertEqual(contact.email, data["email"]) self.assertEqual(contact.phone_number, data["phone_number"]) self.assertTrue(contact.is_accepted)
def setContact(name, phone, email, addr): contact = Contact(name, phone, email, addr) return contact
from contacts.contact import Contact if __name__ == '__main__': Contact.run()
def set_contact(name, phone, email, address): contact = Contact(name, phone, email, address) return contact
def set_contact(name, tel, email, address): contact = Contact(name, tel, email, address) return contact
def set_contact(n1, n2, n3, n4): contact = Contact(n1, n2, n3, n4) return contact
def set_contact(name, phone, email, addr): # set (등록) / 하나씩등록 contact contact = Contact(name, phone, email, addr) return contact
def set_contact(n, p, e, a): contact = Contact(n, p, e, a) return contact