This commit is contained in:
David Kennedy 2023-11-03 12:38:32 -04:00
parent 70faa6beb9
commit d3a3565336
No known key found for this signature in database
GPG key ID: 6528A5386E66B96B
2 changed files with 14 additions and 2 deletions

View file

@ -1105,6 +1105,9 @@ class TestWithDomainPermissions(TestWithUser):
self.domain_just_nameserver, _ = Domain.objects.get_or_create(
name="justnameserver.com"
)
self.domain_no_information, _ = Domain.objects.get_or_create(
name="noinformation.gov"
)
self.domain_dsdata, _ = Domain.objects.get_or_create(name="dnssec-dsdata.gov")
self.domain_multdsdata, _ = Domain.objects.get_or_create(
@ -1278,6 +1281,15 @@ class TestDomainOverview(TestWithDomainPermissions, WebTest):
self.assertContains(detail_page, "(1.2.3.4,")
self.assertContains(detail_page, "2.3.4.5)")
def test_domain_with_no_information_or_application(self):
"""Test that domain management page returns 200 when no
domain information or domain application exist"""
detail_page = self.app.get(
reverse("domain", kwargs={"pk": self.domain_no_information.id})
)
self.assertContains(detail_page, "noinformation.gov")
class TestDomainManagers(TestDomainOverview):
def test_domain_managers(self):

View file

@ -99,8 +99,8 @@ class DomainPermission(PermissionsLoginMixin):
requested_domain = None
if DomainInformation.objects.filter(id=pk).exists():
requested_domain = DomainInformation.objects.get(id=pk)
# if no domain information or domain application exist, the user
# if no domain information or application exist, the user
# should be able to manage the domain; however, if domain information
# and domain application exist, and application is not in valid status,
# user should not be able to manage domain