mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-06-09 22:14:43 +02:00
Fix linting
This commit is contained in:
parent
cc510138cb
commit
0c318e0eea
3 changed files with 19 additions and 10 deletions
|
@ -498,11 +498,17 @@ class DomainApplication(TimeStampedModel):
|
|||
def show_tribal_explanation(self) -> bool:
|
||||
"""Show this step if the tribe is not federally or state recognized."""
|
||||
user_choice = self.organization_type
|
||||
if (user_choice == DomainApplication.OrganizationChoices.TRIBAL):
|
||||
if user_choice == DomainApplication.OrganizationChoices.TRIBAL:
|
||||
# did answer tribal, check the recognition answers
|
||||
if self.federally_recognized_tribe is not None and self.state_recognized_tribe is not None:
|
||||
if (
|
||||
self.federally_recognized_tribe is not None
|
||||
and self.state_recognized_tribe is not None
|
||||
):
|
||||
# have answered these questions
|
||||
if not self.federally_recognized_tribe and not self.state_recognized_tribe:
|
||||
if (
|
||||
not self.federally_recognized_tribe
|
||||
and not self.state_recognized_tribe
|
||||
):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
|
|
@ -120,7 +120,9 @@ class DomainApplicationTests(TestWithUser, WebTest):
|
|||
this test work.
|
||||
"""
|
||||
num_pages_tested = 0
|
||||
SKIPPED_PAGES = 4 # elections, type_of_work, tribal_government, tribal_explanation
|
||||
SKIPPED_PAGES = (
|
||||
4 # elections, type_of_work, tribal_government, tribal_explanation
|
||||
)
|
||||
num_pages = len(self.TITLES) - SKIPPED_PAGES
|
||||
|
||||
type_page = self.app.get(reverse("application:")).follow()
|
||||
|
@ -791,18 +793,21 @@ class DomainApplicationTests(TestWithUser, WebTest):
|
|||
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.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"
|
||||
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
|
||||
|
|
|
@ -96,9 +96,7 @@ class ApplicationWizard(LoginRequiredMixin, TemplateView):
|
|||
Step.ORGANIZATION_FEDERAL: lambda w: w.from_model(
|
||||
"show_organization_federal", False
|
||||
),
|
||||
Step.TRIBAL_GOVERNMENT: lambda w: w.from_model(
|
||||
"show_tribal_government", False
|
||||
),
|
||||
Step.TRIBAL_GOVERNMENT: lambda w: w.from_model("show_tribal_government", False),
|
||||
Step.TRIBAL_EXPLANATION: lambda w: w.from_model(
|
||||
"show_tribal_explanation", False
|
||||
),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue