ran formatting command

This commit is contained in:
asaki222 2024-09-10 11:27:32 -04:00
parent f7c3579a93
commit 1203e54352
No known key found for this signature in database
GPG key ID: 2C4F802060E06EA4
6 changed files with 17 additions and 21 deletions

View file

@ -2221,7 +2221,7 @@ class DomainRequestAdmin(ListHeaderAdmin, ImportExportModelAdmin):
"""Returns the default email associated with the given action needed reason""" """Returns the default email associated with the given action needed reason"""
if not action_needed_reason or action_needed_reason == DomainRequest.ActionNeededReasons.OTHER: if not action_needed_reason or action_needed_reason == DomainRequest.ActionNeededReasons.OTHER:
return None return None
recipient = domain_request.creator recipient = domain_request.creator
# Return the context of the rendered views # Return the context of the rendered views

View file

@ -73,7 +73,6 @@ class CheckUserProfileMiddleware:
finished_setup flag on the current user. If they haven't done so, finished_setup flag on the current user. If they haven't done so,
then we redirect them to the finish setup page.""" then we redirect them to the finish setup page."""
if request.user.is_authenticated: if request.user.is_authenticated:
profile_page = self.profile_page profile_page = self.profile_page
if request.user.verification_type == User.VerificationTypeChoices.REGULAR: if request.user.verification_type == User.VerificationTypeChoices.REGULAR:

View file

@ -263,7 +263,7 @@ class TestDomainRequest(TestCase):
self.check_email_sent( self.check_email_sent(
domain_request, msg, "submit", 1, expected_content="Hi", expected_email=self.dummy_user_2.email domain_request, msg, "submit", 1, expected_content="Hi", expected_email=self.dummy_user_2.email
) )
@less_console_noise_decorator @less_console_noise_decorator
def test_submit_from_started_sends_email_to_creator(self): def test_submit_from_started_sends_email_to_creator(self):
"""Tests if, when the profile feature flag is on, we send an email to the creator""" """Tests if, when the profile feature flag is on, we send an email to the creator"""

View file

@ -627,7 +627,7 @@ class FinishUserProfileTests(TestWithUser, WebTest):
self.app.set_user(incomplete_regular_user.username) self.app.set_user(incomplete_regular_user.username)
# This will redirect the user to the setup page. # This will redirect the user to the setup page.
# Follow implicity checks if our redirect is working. # Follow implicity checks if our redirect is working.
finish_setup_page = self.app.get(reverse("home")).follow() finish_setup_page = self.app.get(reverse("home")).follow()
self._set_session_cookie() self._set_session_cookie()
@ -638,13 +638,13 @@ class FinishUserProfileTests(TestWithUser, WebTest):
self.assertEqual(finish_setup_page.status_code, 200) self.assertEqual(finish_setup_page.status_code, 200)
# We're missing a phone number, so the page should tell us that # We're missing a phone number, so the page should tell us that
self.assertContains(finish_setup_page, "Enter your phone number.") self.assertContains(finish_setup_page, "Enter your phone number.")
# Check for the name of the save button # Check for the name of the save button
self.assertContains(finish_setup_page, "user_setup_save_button") self.assertContains(finish_setup_page, "user_setup_save_button")
# Add a phone number # Add a phone number
finish_setup_form = finish_setup_page.form finish_setup_form = finish_setup_page.form
finish_setup_form["phone"] = "(201) 555-0123" finish_setup_form["phone"] = "(201) 555-0123"
finish_setup_form["title"] = "CEO" finish_setup_form["title"] = "CEO"
@ -654,8 +654,8 @@ class FinishUserProfileTests(TestWithUser, WebTest):
self.assertEqual(save_page.status_code, 200) self.assertEqual(save_page.status_code, 200)
self.assertContains(save_page, "Your profile has been updated.") self.assertContains(save_page, "Your profile has been updated.")
# Try to navigate back to the home page. # Try to navigate back to the home page.
# This is the same as clicking the back button. # This is the same as clicking the back button.
completed_setup_page = self.app.get(reverse("home")) completed_setup_page = self.app.get(reverse("home"))
self.assertContains(completed_setup_page, "Manage your domain") self.assertContains(completed_setup_page, "Manage your domain")
incomplete_regular_user.delete() incomplete_regular_user.delete()
@ -739,7 +739,7 @@ class FinishUserProfileTests(TestWithUser, WebTest):
# Check for the name of the save button # Check for the name of the save button
self.assertContains(finish_setup_page, "user_setup_save_button") self.assertContains(finish_setup_page, "user_setup_save_button")
# Add a phone number # Add a phone number
finish_setup_form = finish_setup_page.form finish_setup_form = finish_setup_page.form
finish_setup_form["first_name"] = "firstname" finish_setup_form["first_name"] = "firstname"
finish_setup_form["phone"] = "(201) 555-0123" finish_setup_form["phone"] = "(201) 555-0123"
@ -751,14 +751,14 @@ class FinishUserProfileTests(TestWithUser, WebTest):
finish_setup_form = completed_setup_page.form finish_setup_form = completed_setup_page.form
# Submit the form using the specific submit button to execute the redirect # Submit the form using the specific submit button to execute the redirect
completed_setup_page = self._submit_form_webtest( completed_setup_page = self._submit_form_webtest(
finish_setup_form, follow=True, name="user_setup_submit_button" finish_setup_form, follow=True, name="user_setup_submit_button"
) )
self.assertEqual(completed_setup_page.status_code, 200) self.assertEqual(completed_setup_page.status_code, 200)
# Assert that we are still on the # Assert that we are still on the
# Assert that we're on the domain request page # Assert that we're on the domain request page
self.assertNotContains(completed_setup_page, "Finish setting up your profile") self.assertNotContains(completed_setup_page, "Finish setting up your profile")
self.assertNotContains(completed_setup_page, "What contact information should we use to reach you?") self.assertNotContains(completed_setup_page, "What contact information should we use to reach you?")
@ -836,15 +836,13 @@ class UserProfileTests(TestWithUser, WebTest):
self.assertEqual(response.status_code, 500) self.assertEqual(response.status_code, 500)
self.assertContains(response, "Your profile") self.assertContains(response, "Your profile")
@less_console_noise_decorator @less_console_noise_decorator
def test_home_page_main_nav(self): def test_home_page_main_nav(self):
"""test that Your profile is in main nav of home page""" """test that Your profile is in main nav of home page"""
response = self.client.get("/", follow=True) response = self.client.get("/", follow=True)
self.assertContains(response, "Your profile") self.assertContains(response, "Your profile")
@less_console_noise_decorator @less_console_noise_decorator
def test_new_request_main_nav(self): def test_new_request_main_nav(self):
"""test that Your profile is in main nav of new request""" """test that Your profile is in main nav of new request"""
@ -894,7 +892,7 @@ class UserProfileTests(TestWithUser, WebTest):
senior_official=contact_user, senior_official=contact_user,
submitter=contact_user, submitter=contact_user,
) )
response = self.client.get(f"/domain-request/{domain_request.id}", follow=True) response = self.client.get(f"/domain-request/{domain_request.id}", follow=True)
self.assertContains(response, "Your profile") self.assertContains(response, "Your profile")
response = self.client.get(f"/domain-request/{domain_request.id}/withdraw", follow=True) response = self.client.get(f"/domain-request/{domain_request.id}/withdraw", follow=True)

View file

@ -439,7 +439,6 @@ class DomainRequestWizard(DomainRequestWizardPermissionView, TemplateView):
if condition: if condition:
step_list.append(step) step_list.append(step)
step_list.remove(Step.YOUR_CONTACT) step_list.remove(Step.YOUR_CONTACT)
return step_list return step_list

View file

@ -45,7 +45,7 @@ class UserProfileView(UserProfilePermissionView, FormMixin):
context["show_confirmation_modal"] = True context["show_confirmation_modal"] = True
return self.render_to_response(context) return self.render_to_response(context)
def dispatch(self, request, *args, **kwargs): # type: ignore def dispatch(self, request, *args, **kwargs): # type: ignore
return super().dispatch(request, *args, **kwargs) return super().dispatch(request, *args, **kwargs)