Exemplo n.º 1
0
    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)
Exemplo n.º 2
0
 def test_address_format(self):
     address = Address('John Smith <*****@*****.**>')
     self.assertEqual(address.format(), 'John Smith <*****@*****.**>')