fix: hide client PDF action from workers
This commit is contained in:
@@ -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})
|
||||
|
||||
Reference in New Issue
Block a user