From f5576725869ecbef3cb0542117e77a55f15b6e23 Mon Sep 17 00:00:00 2001 From: moanos Date: Wed, 5 Feb 2025 20:17:36 +0100 Subject: [PATCH] test: Add test for reporting rules anon --- src/tests/test_views/test_basic_views.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/tests/test_views/test_basic_views.py b/src/tests/test_views/test_basic_views.py index fc0b9bb..5278be4 100644 --- a/src/tests/test_views/test_basic_views.py +++ b/src/tests/test_views/test_basic_views.py @@ -65,3 +65,12 @@ class BasicViewTest(TestCase): data = {"reported_broken_rules": 1, "user_comment": "animal cruelty"} response = self.client.post(reverse('report-adoption-notice', args=str(an.pk)), data=data) self.assertEqual(response.status_code, 302) + + def test_report_adoption_anonymous(self): + an = AdoptionNotice.objects.get(name="TestAdoption0") + response = self.client.get(reverse('report-adoption-notice', args=str(an.pk))) + self.assertEqual(response.status_code, 200) + + data = {"reported_broken_rules": 1, "user_comment": "animal cruelty"} + response = self.client.post(reverse('report-adoption-notice', args=str(an.pk)), data=data) + self.assertEqual(response.status_code, 302)