Esempio n. 1
0
 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)
Esempio n. 2
0
 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)
Esempio n. 3
0
 def test_message_sender(self):
     message = Message(
      "memento mori", datetime(2011, 3, 1, 12, 34, 32), self.contact1
     )
     self.assertIs(message._sender, message.sender())