mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-15 09:07:02 +02:00
Linting
This commit is contained in:
parent
d9408076b1
commit
83c7a5cdfd
4 changed files with 30 additions and 10 deletions
|
@ -252,7 +252,9 @@ class ViewsTest(TestCase):
|
||||||
# mock that callback returns user_info; this is the expected behavior
|
# mock that callback returns user_info; this is the expected behavior
|
||||||
mock_client.callback.side_effect = self.user_info
|
mock_client.callback.side_effect = self.user_info
|
||||||
# patch that the request does not require step up auth
|
# 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):
|
with patch("djangooidc.views._client_is_none", return_value=True):
|
||||||
# TEST
|
# TEST
|
||||||
# test the login callback url
|
# test the login callback url
|
||||||
|
@ -283,7 +285,9 @@ class ViewsTest(TestCase):
|
||||||
# mock that callback returns user_info; this is the expected behavior
|
# mock that callback returns user_info; this is the expected behavior
|
||||||
mock_client.callback.side_effect = self.user_info
|
mock_client.callback.side_effect = self.user_info
|
||||||
# patch that the request does not require step up auth
|
# 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):
|
with patch("djangooidc.views._client_is_none", return_value=True):
|
||||||
# TEST
|
# TEST
|
||||||
# test the login callback url
|
# 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")
|
td, _ = TransitionDomain.objects.get_or_create(username="test@example.com", domain_name="test123.gov")
|
||||||
|
|
||||||
# patch that the request does not require step up auth
|
# 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):
|
with patch("djangooidc.views._client_is_none", return_value=True):
|
||||||
# TEST
|
# TEST
|
||||||
# test the login callback url
|
# test the login callback url
|
||||||
|
@ -346,7 +352,9 @@ class ViewsTest(TestCase):
|
||||||
vip, _ = VerifiedByStaff.objects.get_or_create(email="test@example.com")
|
vip, _ = VerifiedByStaff.objects.get_or_create(email="test@example.com")
|
||||||
|
|
||||||
# patch that the request does not require step up auth
|
# 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):
|
with patch("djangooidc.views._client_is_none", return_value=True):
|
||||||
# TEST
|
# TEST
|
||||||
# test the login callback url
|
# test the login callback url
|
||||||
|
|
|
@ -563,7 +563,12 @@ class MyUserAdmin(BaseUserAdmin):
|
||||||
analyst_fieldsets = (
|
analyst_fieldsets = (
|
||||||
(
|
(
|
||||||
None,
|
None,
|
||||||
{"fields": ("status", "verification_type",)},
|
{
|
||||||
|
"fields": (
|
||||||
|
"status",
|
||||||
|
"verification_type",
|
||||||
|
)
|
||||||
|
},
|
||||||
),
|
),
|
||||||
("Personal Info", {"fields": ("first_name", "last_name", "email")}),
|
("Personal Info", {"fields": ("first_name", "last_name", "email")}),
|
||||||
(
|
(
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
from enum import Enum
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from django.contrib.auth.models import AbstractUser
|
from django.contrib.auth.models import AbstractUser
|
||||||
|
|
|
@ -3043,7 +3043,15 @@ class TestMyUserAdmin(TestCase):
|
||||||
request.user = create_user()
|
request.user = create_user()
|
||||||
fieldsets = self.admin.get_fieldsets(request)
|
fieldsets = self.admin.get_fieldsets(request)
|
||||||
expected_fieldsets = (
|
expected_fieldsets = (
|
||||||
(None, {"fields": ("status", "verification_type",)}),
|
(
|
||||||
|
None,
|
||||||
|
{
|
||||||
|
"fields": (
|
||||||
|
"status",
|
||||||
|
"verification_type",
|
||||||
|
)
|
||||||
|
},
|
||||||
|
),
|
||||||
("Personal Info", {"fields": ("first_name", "last_name", "email")}),
|
("Personal Info", {"fields": ("first_name", "last_name", "email")}),
|
||||||
("Permissions", {"fields": ("is_active", "groups")}),
|
("Permissions", {"fields": ("is_active", "groups")}),
|
||||||
("Important dates", {"fields": ("last_login", "date_joined")}),
|
("Important dates", {"fields": ("last_login", "date_joined")}),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue