mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-02 17:23:32 +02:00
Merge branch 'main' into za/1292-user-domain-role-search-by-email
This commit is contained in:
commit
091c12151b
28 changed files with 361 additions and 54 deletions
|
@ -8,6 +8,7 @@ from registrar.admin import (
|
|||
DomainAdmin,
|
||||
DomainApplicationAdmin,
|
||||
DomainApplicationAdminForm,
|
||||
DomainInvitationAdmin,
|
||||
ListHeaderAdmin,
|
||||
MyUserAdmin,
|
||||
AuditedAdmin,
|
||||
|
@ -848,6 +849,44 @@ class TestDomainApplicationAdmin(MockEppLib):
|
|||
User.objects.all().delete()
|
||||
|
||||
|
||||
class DomainInvitationAdminTest(TestCase):
|
||||
"""Tests for the DomainInvitation page"""
|
||||
|
||||
def setUp(self):
|
||||
"""Create a client object"""
|
||||
self.client = Client(HTTP_HOST="localhost:8080")
|
||||
self.factory = RequestFactory()
|
||||
self.admin = ListHeaderAdmin(model=DomainInvitationAdmin, admin_site=AdminSite())
|
||||
self.superuser = create_superuser()
|
||||
|
||||
def tearDown(self):
|
||||
"""Delete all DomainInvitation objects"""
|
||||
DomainInvitation.objects.all().delete()
|
||||
|
||||
def test_get_filters(self):
|
||||
"""Ensures that our filters are displaying correctly"""
|
||||
# Have to get creative to get past linter
|
||||
p = "adminpass"
|
||||
self.client.login(username="superuser", password=p)
|
||||
|
||||
response = self.client.get(
|
||||
"/admin/registrar/domaininvitation/",
|
||||
{},
|
||||
follow=True,
|
||||
)
|
||||
|
||||
# Assert that the filters are added
|
||||
self.assertContains(response, "invited", count=4)
|
||||
self.assertContains(response, "retrieved", count=4)
|
||||
|
||||
# Check for the HTML context specificially
|
||||
invited_html = '<a href="?status__exact=invited">invited</a>'
|
||||
retrieved_html = '<a href="?status__exact=retrieved">retrieved</a>'
|
||||
|
||||
self.assertContains(response, invited_html, count=1)
|
||||
self.assertContains(response, retrieved_html, count=1)
|
||||
|
||||
|
||||
class UserDomainRoleAdminTest(TestCase):
|
||||
def setUp(self):
|
||||
self.site = AdminSite()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue