Example #1
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)
Example #2
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
     )
Example #5
0
 def test_add_comment_triggers_update(self):
     feedback = FeedbackFactory(decision=self.decision, author=self.user)
     orig_last_modified = self.last_modified()
     comment = CommentFactory(content_object=feedback, user=self.user)
     self.send_comment_posted_signal(comment)
     self.assertTrue(orig_last_modified < self.last_modified())