mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-02 01:03:28 +02:00
Revert "Mark test as an expected failure for now."
This reverts commit 604557e96c
.
This commit is contained in:
parent
b36dbf8ec1
commit
59c67a70d2
1 changed files with 37 additions and 0 deletions
|
@ -758,6 +758,43 @@ class DomainApplicationTests(TestWithUser, WebTest):
|
||||||
# and the step is on the sidebar list.
|
# and the step is on the sidebar list.
|
||||||
self.assertContains(tribal_government_page, self.TITLES[Step.TRIBAL_GOVERNMENT])
|
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):
|
def test_application_ao_dynamic_text(self):
|
||||||
type_page = self.app.get(reverse("application:")).follow()
|
type_page = self.app.get(reverse("application:")).follow()
|
||||||
# django-webtest does not handle cookie-based sessions well because it keeps
|
# django-webtest does not handle cookie-based sessions well because it keeps
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue