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
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