diff --git a/src/djangooidc/tests/test_views.py b/src/djangooidc/tests/test_views.py index faf9cbdd8..36a7e1e47 100644 --- a/src/djangooidc/tests/test_views.py +++ b/src/djangooidc/tests/test_views.py @@ -17,7 +17,7 @@ class ViewsTest(TestCase): def setUp(self): self.client = Client() self.factory = RequestFactory() - + def tearDown(self): User.objects.all().delete() Contact.objects.all().delete() @@ -238,7 +238,7 @@ class ViewsTest(TestCase): # assert that redirect is to / when no 'next' is set self.assertEqual(response.status_code, 302) self.assertEqual(response.url, "/") - + @less_console_noise_decorator def test_login_callback_sets_verification_type_regular(self, mock_client): """ @@ -252,7 +252,9 @@ class ViewsTest(TestCase): # mock that callback returns user_info; this is the expected behavior mock_client.callback.side_effect = self.user_info # patch that the request does not require step up auth - with patch("djangooidc.views._requires_step_up_auth", return_value=False), patch("djangooidc.views._initialize_client") as mock_init_client: + with patch("djangooidc.views._requires_step_up_auth", return_value=False), patch( + "djangooidc.views._initialize_client" + ) as mock_init_client: with patch("djangooidc.views._client_is_none", return_value=True): # TEST # test the login callback url @@ -283,7 +285,9 @@ class ViewsTest(TestCase): # mock that callback returns user_info; this is the expected behavior mock_client.callback.side_effect = self.user_info # patch that the request does not require step up auth - with patch("djangooidc.views._requires_step_up_auth", return_value=False), patch("djangooidc.views._initialize_client") as mock_init_client: + with patch("djangooidc.views._requires_step_up_auth", return_value=False), patch( + "djangooidc.views._initialize_client" + ) as mock_init_client: with patch("djangooidc.views._client_is_none", return_value=True): # TEST # test the login callback url @@ -314,7 +318,9 @@ class ViewsTest(TestCase): td, _ = TransitionDomain.objects.get_or_create(username="test@example.com", domain_name="test123.gov") # patch that the request does not require step up auth - with patch("djangooidc.views._requires_step_up_auth", return_value=False), patch("djangooidc.views._initialize_client") as mock_init_client: + with patch("djangooidc.views._requires_step_up_auth", return_value=False), patch( + "djangooidc.views._initialize_client" + ) as mock_init_client: with patch("djangooidc.views._client_is_none", return_value=True): # TEST # test the login callback url @@ -334,7 +340,7 @@ class ViewsTest(TestCase): @less_console_noise_decorator def test_login_callback_sets_verification_type_verified_by_staff(self, mock_client): - """Test that openid sets the verification type to verified_by_staff + """Test that openid sets the verification type to verified_by_staff on a user which exists in our VerifiedByStaff table""" # SETUP session = self.client.session @@ -346,7 +352,9 @@ class ViewsTest(TestCase): vip, _ = VerifiedByStaff.objects.get_or_create(email="test@example.com") # patch that the request does not require step up auth - with patch("djangooidc.views._requires_step_up_auth", return_value=False), patch("djangooidc.views._initialize_client") as mock_init_client: + with patch("djangooidc.views._requires_step_up_auth", return_value=False), patch( + "djangooidc.views._initialize_client" + ) as mock_init_client: with patch("djangooidc.views._client_is_none", return_value=True): # TEST # test the login callback url diff --git a/src/registrar/admin.py b/src/registrar/admin.py index b7a5a0503..e1378ec53 100644 --- a/src/registrar/admin.py +++ b/src/registrar/admin.py @@ -563,7 +563,12 @@ class MyUserAdmin(BaseUserAdmin): analyst_fieldsets = ( ( None, - {"fields": ("status", "verification_type",)}, + { + "fields": ( + "status", + "verification_type", + ) + }, ), ("Personal Info", {"fields": ("first_name", "last_name", "email")}), ( diff --git a/src/registrar/models/user.py b/src/registrar/models/user.py index 0ae785562..5e4c88f63 100644 --- a/src/registrar/models/user.py +++ b/src/registrar/models/user.py @@ -1,4 +1,3 @@ -from enum import Enum import logging from django.contrib.auth.models import AbstractUser diff --git a/src/registrar/tests/test_admin.py b/src/registrar/tests/test_admin.py index eeda99efb..f853c7b11 100644 --- a/src/registrar/tests/test_admin.py +++ b/src/registrar/tests/test_admin.py @@ -3043,7 +3043,15 @@ class TestMyUserAdmin(TestCase): request.user = create_user() fieldsets = self.admin.get_fieldsets(request) expected_fieldsets = ( - (None, {"fields": ("status", "verification_type",)}), + ( + None, + { + "fields": ( + "status", + "verification_type", + ) + }, + ), ("Personal Info", {"fields": ("first_name", "last_name", "email")}), ("Permissions", {"fields": ("is_active", "groups")}), ("Important dates", {"fields": ("last_login", "date_joined")}),