Ejemplo n.º 1
0
 def test_mailbox(self):
     mbx = Mailbox(name='XXX')
     with self.assertRaises(ValueError):
         mbx.clean()  # Must have either item_id or email_address set
     mbx = Mailbox(email_address='XXX')
     self.assertEqual(hash(mbx), hash('xxx'))
     mbx.item_id = 'YYY'
     self.assertEqual(hash(mbx), hash('YYY'))  # If we have an item_id, use that for uniqueness
Ejemplo n.º 2
0
 def test_mailbox(self):
     mbx = Mailbox(name="XXX")
     with self.assertRaises(ValueError):
         mbx.clean()  # Must have either item_id or email_address set
     mbx = Mailbox(email_address="XXX")
     self.assertEqual(hash(mbx), hash("xxx"))
     mbx.item_id = "YYY"
     self.assertEqual(
         hash(mbx),
         hash("YYY"))  # If we have an item_id, use that for uniqueness