def test_subscribe_task(self): recipients = notifications_service.get_notification_recipients( self.task_dict) self.assertFalse(self.user_id in recipients) self.post("/actions/user/tasks/%s/subscribe" % self.task_dict["id"], {}) recipients = notifications_service.get_notification_recipients( self.task_dict) self.assertTrue(self.user_id in recipients)
def test_subscribe_sequence(self): self.generate_fixture_comment() recipients = notifications_service.get_notification_recipients( self.task_dict) self.assertFalse(self.person_dict["id"] in recipients) notifications_service.subscribe_to_sequence(self.person_dict["id"], self.sequence_dict["id"], self.task_type_dict["id"]) recipients = notifications_service.get_notification_recipients( self.task_dict) self.assertTrue(self.person_dict["id"] in recipients)
def test_subscribe_sequence(self): recipients = notifications_service.get_notification_recipients( self.shot_task_dict) self.assertFalse(self.user_id in recipients) path = "/actions/user/sequences/%s/task-types/%s/subscribe" % ( self.sequence_dict["id"], self.task_type_dict["id"]) print(path) self.post(path, {}) recipients = notifications_service.get_notification_recipients( self.shot_task_dict) self.assertTrue(self.user_id in recipients)
def test_subscribe_task(self): self.generate_fixture_comment() recipients = notifications_service.get_notification_recipients( self.task_dict) self.assertFalse(self.person_dict["id"] in recipients) notifications_service.subscribe_to_task(self.person_dict["id"], self.task_dict["id"]) subscription = notifications_service.get_task_subscription_raw( self.person_dict["id"], self.task_dict["id"]) self.assertIsNotNone(subscription) recipients = notifications_service.get_notification_recipients( self.task_dict) self.assertTrue(self.person_dict["id"] in recipients)
def test_unsubscribe_sequence(self): path = "/actions/user/sequences/%s/task-types/%s/" % ( self.sequence_dict["id"], self.task_type_dict["id"]) self.post(path + "subscribe", {}) self.delete(path + "unsubscribe") recipients = notifications_service.get_notification_recipients( self.shot_task_dict) self.assertFalse(self.user_id in recipients)
def test_get_notification_recipients(self): self.generate_fixture_comment() person_ids = notifications_service.get_notification_recipients( self.task_dict) self.assertEqual(len(person_ids), 2)