Example #1
0
 def test_create_notifications_for_task_and_comment_with_mentions(self):
     self.generate_fixture_comment()
     self.comment["mentions"] = [self.person.id]
     notifications_service.create_notifications_for_task_and_comment(
         self.task_dict, self.comment)
     notifications = Notification.get_all()
     self.assertEqual(len(notifications), 2)
Example #2
0
 def test_create_notifications_for_task_and_comment(self):
     self.generate_fixture_comment()
     notifications_service.create_notifications_for_task_and_comment(
         self.task_dict, self.comment)
     notifications = Notification.get_all()
     self.assertEqual(len(notifications), 1)
     self.assertEqual(str(notifications[0].author_id), self.user["id"])
Example #3
0
 def test_create_assignation_notification(self):
     self.generate_fixture_comment()
     notifications_service.create_assignation_notification(
         self.task_dict["id"], self.person.id)
     notifications = Notification.get_all()
     self.assertEqual(len(notifications), 1)
     self.assertEqual(notifications[0].type, "assignation")
     self.assertEqual(str(notifications[0].author_id),
                      self.task_dict["assigner_id"])