mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-08-04 17:01:56 +02:00
Merge conflict fixes
This commit is contained in:
parent
7b773c16b7
commit
763a1c51fc
3 changed files with 6 additions and 64 deletions
|
@ -1275,64 +1275,6 @@ class TestDomainRequestAdmin(MockEppLib):
|
|||
self.assertContains(response, "When a domain request is in ineligible status")
|
||||
self.assertContains(response, "Yes, select ineligible status")
|
||||
|
||||
def test_user_sets_restricted_status_modal(self):
|
||||
"""Tests the modal for when a user sets the status to restricted"""
|
||||
with less_console_noise():
|
||||
# make sure there is no user with this email
|
||||
EMAIL = "mayor@igorville.gov"
|
||||
User.objects.filter(email=EMAIL).delete()
|
||||
|
||||
# Create a sample domain request
|
||||
domain_request = completed_domain_request(status=DomainRequest.DomainRequestStatus.IN_REVIEW)
|
||||
|
||||
p = "userpass"
|
||||
self.client.login(username="staffuser", password=p)
|
||||
response = self.client.get(
|
||||
"/admin/registrar/domainrequest/{}/change/".format(domain_request.pk),
|
||||
follow=True,
|
||||
)
|
||||
|
||||
self.assertEqual(response.status_code, 200)
|
||||
self.assertContains(response, domain_request.requested_domain.name)
|
||||
|
||||
# Check that the modal has the right content
|
||||
# Check for the header
|
||||
self.assertContains(response, "Are you sure you want to select ineligible status?")
|
||||
|
||||
# Check for some of its body
|
||||
self.assertContains(response, "When a domain request is in ineligible status")
|
||||
|
||||
# Check for some of the button content
|
||||
self.assertContains(response, "Yes, select ineligible status")
|
||||
|
||||
# Create a mock request
|
||||
request = self.factory.post(
|
||||
"/admin/registrar/domainrequest/{}/change/".format(domain_request.pk), follow=True
|
||||
)
|
||||
with boto3_mocking.clients.handler_for("sesv2", self.mock_client):
|
||||
# Modify the domain request's property
|
||||
domain_request.status = DomainRequest.DomainRequestStatus.INELIGIBLE
|
||||
|
||||
# Use the model admin's save_model method
|
||||
self.admin.save_model(request, domain_request, form=None, change=True)
|
||||
|
||||
# Test that approved domain exists and equals requested domain
|
||||
self.assertEqual(domain_request.creator.status, "restricted")
|
||||
|
||||
# 'Get' to the domain request again
|
||||
response = self.client.get(
|
||||
"/admin/registrar/domainrequest/{}/change/".format(domain_request.pk),
|
||||
follow=True,
|
||||
)
|
||||
|
||||
self.assertEqual(response.status_code, 200)
|
||||
self.assertContains(response, domain_request.requested_domain.name)
|
||||
|
||||
# The modal should be unchanged
|
||||
self.assertContains(response, "Are you sure you want to select ineligible status?")
|
||||
self.assertContains(response, "When a domain request is in ineligible status")
|
||||
self.assertContains(response, "Yes, select ineligible status")
|
||||
|
||||
def test_readonly_when_restricted_creator(self):
|
||||
with less_console_noise():
|
||||
domain_request = completed_domain_request(status=DomainRequest.DomainRequestStatus.IN_REVIEW)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue