Exemplo n.º 1
0
 def test_string_formatting(self):
     """ Test the human representation of a message """
     message = Message.objects.get(pk=1)
     truncated_body = truncate_words(message.body, 10)
     self.assertEqual(message.__str__(),
                          truncated_body)
Exemplo n.º 2
0
 def __str__(self):
     """ Human representation, displaying first ten words of the body. """
     truncated_body = truncate_words(self.body, 10)
     return "%(truncated_body)s" % {'truncated_body': truncated_body}
Exemplo n.º 3
0
 def test_string_formatting(self):
     """Test the human representation of a message"""
     message = Message.objects.get(pk=1)
     truncated_body = truncate_words(message.body, 10)
     self.assertEqual(message.__str__(), truncated_body)
Exemplo n.º 4
0
 def __unicode__(self):
     """ Human representation, displaying first ten words of the body. """
     truncated_body = truncate_words(self.body, 10)
     return "%(truncated_body)s" % {'truncated_body': truncated_body}