def test_address_comparity(self): a = Address('test', 'example.com', 'John Smith') b = Address('John Smith <*****@*****.**>') self.assertEqual(a, b) b = Address.parse('John Smith <*****@*****.**>') self.assertEqual(a, b) c = Address('Joe Bloggs <*****@*****.**>') self.assertNotEqual(b, c) c = Address('Joe Bloggs <*****@*****.**>') self.assertNotEqual(b, c)
def test_address_format(self): address = Address('John Smith <*****@*****.**>') self.assertEqual(address.format(), 'John Smith <*****@*****.**>')