fix: hide client PDF action from workers

This commit is contained in:
MS.Kondratev
2026-07-15 00:18:59 +05:00
parent 3557022817
commit 4dd08624f7
2 changed files with 6 additions and 1 deletions
+5
View File
@@ -50,6 +50,11 @@ class MonthlyReportTests(TestCase):
response = self.client.get(reverse("monthly-report"), {"user": other.pk, "year": 2026, "month": 7})
self.assertEqual(response.context["report"]["user"], self.user)
def test_worker_does_not_see_client_pdf_button(self):
self.client.force_login(self.user)
response = self.client.get(reverse("monthly-report"), {"year": 2026, "month": 7})
self.assertNotContains(response, "PDF для клиента")
def test_client_pdf_is_generated_for_one_company(self):
self.client.force_login(self.user)
response = self.client.get(reverse("company-report-pdf", args=(self.company_a.pk,)), {"year": 2026, "month": 7})