Revert "Mark test as an expected failure for now."

This reverts commit 604557e96c.
This commit is contained in:
Neil Martinsen-Burrell 2023-01-30 11:22:04 -06:00
parent b36dbf8ec1
commit 59c67a70d2
No known key found for this signature in database
GPG key ID: 6A3C818CC10D0184

View file

@ -758,6 +758,43 @@ class DomainApplicationTests(TestWithUser, WebTest):
# and the step is on the sidebar list.
self.assertContains(tribal_government_page, self.TITLES[Step.TRIBAL_GOVERNMENT])
def test_application_tribal_explanation(self):
"""Unrecognized tribes have to answer an additional question."""
type_page = self.app.get(reverse("application:")).follow()
# django-webtest does not handle cookie-based sessions well because it keeps
# resetting the session key on each new request, thus destroying the concept
# of a "session". We are going to do it manually, saving the session ID here
# and then setting the cookie on each request.
session_id = self.app.cookies[settings.SESSION_COOKIE_NAME]
type_form = type_page.form
type_form[
"organization_type-organization_type"
] = DomainApplication.OrganizationChoices.TRIBAL
self.app.set_cookie(settings.SESSION_COOKIE_NAME, session_id)
type_result = type_page.form.submit()
# the tribal government page comes immediately afterwards
self.assertIn("/tribal_government", type_result.headers["Location"])
# follow first redirect
self.app.set_cookie(settings.SESSION_COOKIE_NAME, session_id)
tribal_government_page = type_result.follow()
# Enter a tribe name but don't check either state or federal recognition
tribal_government_page.form["tribal_government-tribe_name"] = "Tribe name"
self.app.set_cookie(settings.SESSION_COOKIE_NAME, session_id)
tribal_government_result = tribal_government_page.form.submit()
# should be a redirect to tribal_more_information
self.assertIn("/tribal_more_information", tribal_government_result.headers["Location"])
self.app.set_cookie(settings.SESSION_COOKIE_NAME, session_id)
tribal_more_information_page = tribal_government_result.follow()
# put an explanation and submit
tribal_more_information_page.form["tribal_more_information-more_organization_information"] = "Some explanation"
self.app.set_cookie(settings.SESSION_COOKIE_NAME, session_id)
result = tribal_more_information_page.form.submit()
# result should be a success
self.assertEqual(result.status_code, 200)
def test_application_ao_dynamic_text(self):
type_page = self.app.get(reverse("application:")).follow()
# django-webtest does not handle cookie-based sessions well because it keeps