def test_notify_a_set_of_users(self):
     users = [G(User) for i in range(5)]
     services.notify_users(User.objects.all(), "Hello everybody!")
     for user in users:
         self.assertEqual(
             1,
             Notification.objects.filter(recipient=user).count())
    def test_notify_a_set_of_users(self):
        users = UserFactory.create_batch(3)
        subj = "Hello everyone!"
        body = "This is the notification body."

        services.notify_users(User.objects.all(), subj, body=body)
        for user in users:
            user_notification = Notification.objects.get(recipient=user)
            self.assertEqual(user_notification.subject, subj)
            self.assertEqual(user_notification.body, body)
Example #3
0
 def test_notify_a_set_of_users(self):
     users = [G(User) for i in range(5)]
     services.notify_users(User.objects.all(), "Hello everybody!")
     for user in users:
         self.assertEqual(1, Notification.objects.filter(
             recipient=user).count())