def test_can_update_message_sender(self): message = Message( "memento mori", datetime(2011, 3, 1, 12, 34, 32), self.contact1 ) message.sender(self.contact2) self.assertEqual(message._sender, self.contact2)
def test_new_sender_must_be_contact(self): message = Message( "memento mori", datetime(2011, 3, 1, 12, 34, 32), self.contact1 ) with self.assertRaises(TypeError): message.sender(1000)
def test_message_sender(self): message = Message( "memento mori", datetime(2011, 3, 1, 12, 34, 32), self.contact1 ) self.assertIs(message._sender, message.sender())