updated tests related to updated permissions

This commit is contained in:
David Kennedy 2025-03-17 15:31:14 -04:00
parent f275245f69
commit 07b1010dd4
No known key found for this signature in database
GPG key ID: 6528A5386E66B96B
2 changed files with 9 additions and 8 deletions

View file

@ -1457,10 +1457,11 @@ class SeniorOfficialAdmin(ListHeaderAdmin):
# Check if user is in OMB analysts group
if request.user.groups.filter(name="omb_analysts_group").exists():
annotated_qs = self.get_annotated_queryset(qs)
return annotated_qs.filter(
converted_federal_type=BranchChoices.EXECUTIVE,
)
# annotated_qs = self.get_annotated_queryset(qs)
# return annotated_qs.filter(
# converted_federal_type=BranchChoices.EXECUTIVE,
# )
return qs.filter(federal_agency__federal_type=BranchChoices.EXECUTIVE)
return qs # Return full queryset if the user doesn't have the restriction

View file

@ -3819,8 +3819,8 @@ class TestFederalAgencyAdmin(TestCase):
self.assertNotContains(response, "id_federal_type")
self.assertNotContains(response, "id_acronym")
self.assertNotContains(response, "id_is_fceb")
self.assertNotContains(response, "closelink")
self.assertContains(response, "Save")
self.assertContains(response, "closelink")
self.assertNotContains(response, "Save")
self.assertNotContains(response, "Delete")
@less_console_noise_decorator
@ -4083,8 +4083,8 @@ class TestPortfolioAdmin(TestCase):
self.assertNotContains(response, "id_city")
self.assertNotContains(response, "id_zipcode")
self.assertNotContains(response, "id_urbanization")
self.assertNotContains(response, "closelink")
self.assertContains(response, "Save")
self.assertContains(response, "closelink")
self.assertNotContains(response, "Save")
self.assertNotContains(response, "Delete")
@less_console_noise_decorator