mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-08-11 20:19:38 +02:00
added test
This commit is contained in:
parent
6145005363
commit
85503160f2
1 changed files with 25 additions and 0 deletions
|
@ -443,6 +443,15 @@ class TestDomainDetailDomainRenewal(TestDomainOverview):
|
||||||
name="domainrenewal.gov",
|
name="domainrenewal.gov",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
self.domainnotexpiring, _ = Domain.objects.get_or_create(
|
||||||
|
name="domainnotexpiring.gov",
|
||||||
|
expiration_date=timezone.now().date() + timedelta(days=65)
|
||||||
|
)
|
||||||
|
|
||||||
|
self.domainnodomainmanager, _ = Domain.objects.get_or_create(
|
||||||
|
name="domainnodomainmanager"
|
||||||
|
)
|
||||||
|
|
||||||
UserDomainRole.objects.get_or_create(
|
UserDomainRole.objects.get_or_create(
|
||||||
user=self.user, domain=self.domaintorenew, role=UserDomainRole.Roles.MANAGER
|
user=self.user, domain=self.domaintorenew, role=UserDomainRole.Roles.MANAGER
|
||||||
)
|
)
|
||||||
|
@ -656,6 +665,22 @@ class TestDomainDetailDomainRenewal(TestDomainOverview):
|
||||||
self.assertEqual(edit_page.status_code, 200)
|
self.assertEqual(edit_page.status_code, 200)
|
||||||
self.assertContains(edit_page, "Domain managers can update all information related to a domain")
|
self.assertContains(edit_page, "Domain managers can update all information related to a domain")
|
||||||
|
|
||||||
|
@override_flag("domain_renewal", active=True)
|
||||||
|
def test_domain_renewal_form_not_expired_or_expiring(self):
|
||||||
|
with less_console_noise():
|
||||||
|
# Start on the Renewal page for the domain
|
||||||
|
renewal_page = self.client.get(reverse("domain-renewal", kwargs={"pk": self.domainnotexpiring.id}))
|
||||||
|
self.assertEqual(renewal_page.status_code, 403)
|
||||||
|
|
||||||
|
@override_flag("domain_renewal", active=True)
|
||||||
|
def test_domain_renewal_form_does_not_appear_if_not_domain_manager(self):
|
||||||
|
with patch.object(Domain, "is_expired", self.custom_is_expired_true), patch.object(
|
||||||
|
Domain, "is_expired", self.custom_is_expired_true
|
||||||
|
):
|
||||||
|
renewal_page = self.client.get(reverse("domain-renewal", kwargs={"pk": self.domainnodomainmanager.id}))
|
||||||
|
self.assertEqual(renewal_page.status_code, 403)
|
||||||
|
|
||||||
|
|
||||||
@override_flag("domain_renewal", active=True)
|
@override_flag("domain_renewal", active=True)
|
||||||
def test_ack_checkbox_not_checked(self):
|
def test_ack_checkbox_not_checked(self):
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue