mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-30 22:46:30 +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",
|
||||
)
|
||||
|
||||
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(
|
||||
user=self.user, domain=self.domaintorenew, role=UserDomainRole.Roles.MANAGER
|
||||
)
|
||||
|
@ -655,7 +664,23 @@ class TestDomainDetailDomainRenewal(TestDomainOverview):
|
|||
edit_page = renewal_page.click(href=edit_button_url, index=1)
|
||||
self.assertEqual(edit_page.status_code, 200)
|
||||
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)
|
||||
def test_ack_checkbox_not_checked(self):
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue