Exemple #1
0
 def test_text(self):
     user = self.users[0]
     text = Notification.truncate_text("test")
     obj, created = Notification.objects.get_or_create(
         user=user,
         course=self.course,
         text=text,
         image_url='test_image_url',
         link='test_link')
     assert obj.text == text
     assert len(obj.text) <= 100
Exemple #2
0
 def test_text(self):
     user = self.users[0]
     text = Notification.truncate_text("test")
     obj, created = Notification.objects.get_or_create(
         user=user,
         course=self.course,
         text=text,
         image_url='test_image_url',
         link='test_link'
     )
     assert obj.text == text
     assert len(obj.text) <= 100
Exemple #3
0
 def item_title(self, item):
     return Notification.truncate_text(item.text)