예제 #1
0
 def test_get_organization_returns_organization_for_feedback(self):
     expected_organization = OrganizationFactory.build(id=1)
     decision = DecisionFactory.build(id=2,
                                      organization=expected_organization)
     feedback = FeedbackFactory.build(decision=decision)
     settings_handler = ObservationManager()
     actual_organization = settings_handler._get_organization(feedback)
     self.assertEqual(expected_organization, actual_organization)
예제 #2
0
 def test_include_watchers_adds_watchers_for_feedback(self):
     decision = DecisionFactory.build(id=1)
     decision = add_watchers(decision)
     feedback = FeedbackFactory.build(decision=decision)
     settings_handler = ObservationManager()
     settings_handler.include_watchers(feedback)
     self.assertSetEqual(
         set([watcher.user for watcher in decision.watchers.all()]),
         settings_handler.recipient_list)
예제 #3
0
 def test_get_organization_returns_organization_for_comment(self):
     expected_organization = OrganizationFactory.build(id=1)
     decision = DecisionFactory.build(id=2,
                                      organization=expected_organization)
     feedback = FeedbackFactory.build(id=2, decision=decision)
     comment = CommentFactory.build()
     comment.content_object = feedback
     settings_handler = ObservationManager()
     actual_organization = settings_handler._get_organization(comment)
     self.assertEqual(expected_organization, actual_organization)
 def test_get_organization_returns_organization_for_feedback(self):
     expected_organization = OrganizationFactory.build(id=1)
     decision = DecisionFactory.build(
         id=2,
         organization=expected_organization
     )
     feedback = FeedbackFactory.build(decision=decision)
     settings_handler = ObservationManager()
     actual_organization = settings_handler._get_organization(feedback)
     self.assertEqual(expected_organization, actual_organization)
 def test_include_watchers_adds_watchers_for_feedback(self):
     decision = DecisionFactory.build(id=1)
     decision = add_watchers(decision)
     feedback = FeedbackFactory.build(decision=decision)
     settings_handler = ObservationManager()
     settings_handler.include_watchers(feedback)
     self.assertSetEqual(
             set([watcher.user for watcher in decision.watchers.all()]),
             settings_handler.recipient_list
     )
예제 #6
0
 def test_include_watchers_adds_watchers_for_comments(self):
     decision = DecisionFactory.build(id=1)
     decision = add_watchers(decision)
     feedback = FeedbackFactory.build(id=2, decision=decision)
     comment = CommentFactory.build()
     comment.content_object = feedback
     settings_handler = ObservationManager()
     settings_handler.include_watchers(comment)
     self.assertSetEqual(
         set([watcher.user for watcher in decision.watchers.all()]),
         settings_handler.recipient_list)
 def test_get_organization_returns_organization_for_comment(self):
     expected_organization = OrganizationFactory.build(id=1)
     decision = DecisionFactory.build(
         id=2,
         organization=expected_organization
     )
     feedback = FeedbackFactory.build(id=2, decision=decision)
     comment = CommentFactory.build()
     comment.content_object = feedback
     settings_handler = ObservationManager()
     actual_organization = settings_handler._get_organization(comment)
     self.assertEqual(expected_organization, actual_organization)
 def test_include_watchers_adds_watchers_for_comments(self):
     decision = DecisionFactory.build(id=1)
     decision = add_watchers(decision)
     feedback = FeedbackFactory.build(id=2, decision=decision)
     comment = CommentFactory.build()
     comment.content_object = feedback
     settings_handler = ObservationManager()
     settings_handler.include_watchers(comment)
     self.assertSetEqual(
             set([watcher.user for watcher in decision.watchers.all()]),
             settings_handler.recipient_list
     )