updated the tests

This commit is contained in:
asaki222 2024-10-23 20:57:54 -04:00
parent 37ebe4e59b
commit eb2a5f6a17
No known key found for this signature in database
GPG key ID: 2C4F802060E06EA4
2 changed files with 30719 additions and 2 deletions

30711
src/output.html Normal file

File diff suppressed because one or more lines are too long

View file

@ -576,9 +576,15 @@ class TestDomainRequestAdmin(MockEppLib):
response = self.client.get("/admin/registrar/domainrequest/?generic_org_type__exact=federal") response = self.client.get("/admin/registrar/domainrequest/?generic_org_type__exact=federal")
# There are 2 template references to Federal (4) and two in the results data # There are 2 template references to Federal (4) and two in the results data
# of the request # of the request
self.assertContains(response, "Federal", count=52) html_content = response.content.decode('utf-8')
# Write the HTML content to a file
with open("output.html", "w", encoding="utf-8") as html_file:
html_file.write(html_content)
self.assertContains(response, "Federal", count=48)
# This may be a bit more robust # This may be a bit more robust
self.assertContains(response, '<td class="field-generic_org_type">Federal</td>', count=1) self.assertContains(response, '<td class="field-converted_generic_org_type">federal</td>', count=1)
# Now let's make sure the long description does not exist # Now let's make sure the long description does not exist
self.assertNotContains(response, "Federal: an agency of the U.S. government") self.assertNotContains(response, "Federal: an agency of the U.S. government")