Skip to content

Commit

Permalink
Add test for ensuring moderators cannot see abuse reports they have made
Browse files Browse the repository at this point in the history
  • Loading branch information
nlhkabu committed Jun 7, 2015
1 parent 8081ff9 commit 5d7e0a5
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions connect/moderation/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,21 @@ def test_moderator_cannot_see_abuse_reports_about_themself(self):
self.assertEqual(len(context_reports), 1)
self.assertIn(self.abuse_report, context_reports)

def test_moderator_cannot_see_abuse_reports_when_they_have_made_complaint(self):
moderator_abuse_report = AbuseReportFactory(
logged_by=self.moderator
)

self.client.login(username=self.moderator.email, password='pass')
response = self.client.get(reverse('moderation:review-abuse'))

# We should only see self.abuse_report - as this is the only undecided
# abuse report that is not made by the logged in moderator
context_reports = response.context['reports']

self.assertEqual(len(context_reports), 1)
self.assertIn(self.abuse_report, context_reports)

def test_invalid_report_id_raises_404(self):
self.client.login(username=self.moderator.email, password='pass')
response = self.post_data(AbuseReport.BAN, 'comment',
Expand Down

0 comments on commit 5d7e0a5

Please sign in to comment.