mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-23 10:01:04 +00:00
Adds test for report comments
This commit is contained in:
parent
9245b9d9ca
commit
7323f63803
1 changed files with 15 additions and 0 deletions
|
@ -68,6 +68,21 @@ class ReportViews(TestCase):
|
|||
result.render()
|
||||
self.assertEqual(result.status_code, 200)
|
||||
|
||||
def test_report_comment(self):
|
||||
""" comment on a report """
|
||||
view = views.Report.as_view()
|
||||
request = self.factory.post("", {"note": "hi"})
|
||||
request.user = self.local_user
|
||||
request.user.is_superuser = True
|
||||
report = models.Report.objects.create(reporter=self.local_user, user=self.rat)
|
||||
|
||||
view(request, report.id)
|
||||
|
||||
comment = models.ReportComment.objects.get()
|
||||
self.assertEqual(comment.user, self.local_user)
|
||||
self.assertEqual(comment.note, "hi")
|
||||
self.assertEqual(comment.report, report)
|
||||
|
||||
def test_make_report(self):
|
||||
""" a user reports another user """
|
||||
form = forms.ReportForm()
|
||||
|
|
Loading…
Reference in a new issue