Black changes - would not pass otherwise

This commit is contained in:
zandercymatics 2023-08-17 15:32:19 -06:00
parent 9ed83a51da
commit 2db74e6b00
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
4 changed files with 38 additions and 9 deletions

View file

@ -4,7 +4,10 @@ from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from django.contrib.contenttypes.models import ContentType
from django.http.response import HttpResponseRedirect
from django.urls import reverse
from registrar.models.utility.admin_form_order_helper import AdminFormOrderHelper, SortingDict # noqa
from registrar.models.utility.admin_form_order_helper import (
AdminFormOrderHelper,
SortingDict,
)
from . import models
logger = logging.getLogger(__name__)

View file

@ -57,7 +57,7 @@ class AdminFormOrderHelper:
# Only order if we choose to do so
# noqa for the linter... reduces readability otherwise
if _order_by_list is not None and _order_by_list != []: # noqa
if _order_by_list is not None and _order_by_list != []: # noqa
form_field.queryset = form_field.queryset.order_by(*_order_by_list)
return form_field

View file

@ -10,7 +10,16 @@ from typing import List, Dict
from django.conf import settings
from django.contrib.auth import get_user_model, login
from registrar.models import Contact, DraftDomain, Website, DomainApplication, DomainInvitation, User, DomainInformation, Domain # noqa
from registrar.models import (
Contact,
DraftDomain,
Website,
DomainApplication,
DomainInvitation,
User,
DomainInformation,
Domain,
)
logger = logging.getLogger(__name__)
@ -115,7 +124,7 @@ class AuditedAdminMockData:
as a way to optionally include metadata in the string itself. Can be further expanded on.
Came from a bug where different querysets used in testing would effectively be 'anonymized', wherein
it would only display a list of types, but not include the variable name.
""" # noqa
""" # noqa
# Constants for different domain object types
INFORMATION = "information"
@ -207,7 +216,7 @@ class AuditedAdminMockData:
In more detail: domain_type specifies what kind of domain object you'd like to create, i.e.
domain_application (APPLICATION), or domain_information (INFORMATION).
""" # noqa
""" # noqa
common_args = self.get_common_domain_arg_dictionary(
item_name, org_type, federal_type, purpose
)

View file

@ -1,9 +1,26 @@
from django.test import TestCase, RequestFactory, Client
from django.contrib.admin.sites import AdminSite
# noqa is used on all three of these as the linter doesn't like the length of this line
from registrar.admin import DomainApplicationAdmin, ListHeaderAdmin, MyUserAdmin, AuditedAdmin # noqa
from registrar.models import DomainApplication, DomainInformation, User, Contact, DomainInvitation # noqa
from .common import completed_application, mock_user, create_superuser, create_user, multiple_unalphabetical_domain_objects # noqa
from registrar.admin import (
DomainApplicationAdmin,
ListHeaderAdmin,
MyUserAdmin,
AuditedAdmin,
)
from registrar.models import (
DomainApplication,
DomainInformation,
User,
Contact,
DomainInvitation,
)
from .common import (
completed_application,
mock_user,
create_superuser,
create_user,
multiple_unalphabetical_domain_objects,
)
from django.contrib.auth import get_user_model