unit tests

This commit is contained in:
Rachid Mrad 2024-07-17 21:04:59 -04:00
parent 72ee81a43c
commit ea6ccae948
No known key found for this signature in database
7 changed files with 309 additions and 43 deletions

View file

@ -3710,6 +3710,22 @@ class TestMyUserAdmin(MockDb):
expected_href = reverse("admin:registrar_domain_change", args=[domain_deleted.pk])
self.assertNotContains(response, expected_href)
def test_analyst_can_see_selects_for_portfolio_role_and_permissions_in_user_form(self):
"""Can only test for the presence of a base element. The multiselects and the h2->h3 conversion are all
dynamically generated."""
p = "userpass"
self.client.login(username="staffuser", password=p)
response = self.client.get(
"/admin/registrar/user/{}/change/".format(self.meoward_user.id),
follow=True,
)
self.assertEqual(response.status_code, 200)
self.assertContains(response,"Portfolio roles:")
self.assertContains(response,"Portfolio additional permissions:")
class AuditedAdminTest(TestCase):
def setUp(self):