mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-08-15 05:54:11 +02:00
Black formatting
This commit is contained in:
parent
d539740ae6
commit
12b2f93cb1
2 changed files with 39 additions and 29 deletions
|
@ -92,8 +92,10 @@ def less_console_noise(output_stream=None):
|
||||||
# we opened output_stream so we have to close it
|
# we opened output_stream so we have to close it
|
||||||
output_stream.close()
|
output_stream.close()
|
||||||
|
|
||||||
|
|
||||||
class GenericTestHelper(TestCase):
|
class GenericTestHelper(TestCase):
|
||||||
"""A helper class that contains various helper functions for TestCases"""
|
"""A helper class that contains various helper functions for TestCases"""
|
||||||
|
|
||||||
def __init__(self, admin, model=None, url=None, user=None, factory=None, **kwargs):
|
def __init__(self, admin, model=None, url=None, user=None, factory=None, **kwargs):
|
||||||
"""
|
"""
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
|
@ -330,7 +330,7 @@ class TestDomainApplicationAdmin(MockEppLib):
|
||||||
user=self.superuser,
|
user=self.superuser,
|
||||||
admin=self.admin,
|
admin=self.admin,
|
||||||
url="/admin/registrar/DomainApplication/",
|
url="/admin/registrar/DomainApplication/",
|
||||||
model=DomainApplication
|
model=DomainApplication,
|
||||||
)
|
)
|
||||||
|
|
||||||
def test_domain_sortable(self):
|
def test_domain_sortable(self):
|
||||||
|
@ -359,16 +359,22 @@ class TestDomainApplicationAdmin(MockEppLib):
|
||||||
new_user.save()
|
new_user.save()
|
||||||
|
|
||||||
# Assert that our sort works correctly
|
# Assert that our sort works correctly
|
||||||
self.test_helper.assert_table_sorted("5", (
|
self.test_helper.assert_table_sorted(
|
||||||
|
"5",
|
||||||
|
(
|
||||||
"submitter__first_name",
|
"submitter__first_name",
|
||||||
"submitter__last_name",
|
"submitter__last_name",
|
||||||
))
|
),
|
||||||
|
)
|
||||||
|
|
||||||
# Assert that sorting in reverse works correctly
|
# Assert that sorting in reverse works correctly
|
||||||
self.test_helper.assert_table_sorted("-5", (
|
self.test_helper.assert_table_sorted(
|
||||||
|
"-5",
|
||||||
|
(
|
||||||
"-submitter__first_name",
|
"-submitter__first_name",
|
||||||
"-submitter__last_name",
|
"-submitter__last_name",
|
||||||
))
|
),
|
||||||
|
)
|
||||||
|
|
||||||
def test_investigator_sortable(self):
|
def test_investigator_sortable(self):
|
||||||
"""Tests if the DomainApplication sorts by domain correctly"""
|
"""Tests if the DomainApplication sorts by domain correctly"""
|
||||||
|
@ -382,16 +388,22 @@ class TestDomainApplicationAdmin(MockEppLib):
|
||||||
new_user.save()
|
new_user.save()
|
||||||
|
|
||||||
# Assert that our sort works correctly
|
# Assert that our sort works correctly
|
||||||
self.test_helper.assert_table_sorted("6", (
|
self.test_helper.assert_table_sorted(
|
||||||
|
"6",
|
||||||
|
(
|
||||||
"investigator__first_name",
|
"investigator__first_name",
|
||||||
"investigator__last_name",
|
"investigator__last_name",
|
||||||
))
|
),
|
||||||
|
)
|
||||||
|
|
||||||
# Assert that sorting in reverse works correctly
|
# Assert that sorting in reverse works correctly
|
||||||
self.test_helper.assert_table_sorted("-6", (
|
self.test_helper.assert_table_sorted(
|
||||||
|
"-6",
|
||||||
|
(
|
||||||
"-investigator__first_name",
|
"-investigator__first_name",
|
||||||
"-investigator__last_name",
|
"-investigator__last_name",
|
||||||
))
|
),
|
||||||
|
)
|
||||||
|
|
||||||
def test_short_org_name_in_applications_list(self):
|
def test_short_org_name_in_applications_list(self):
|
||||||
"""
|
"""
|
||||||
|
@ -975,7 +987,7 @@ class DomainInformationAdminTest(TestCase):
|
||||||
user=self.superuser,
|
user=self.superuser,
|
||||||
admin=self.admin,
|
admin=self.admin,
|
||||||
url="/admin/registrar/DomainInformation/",
|
url="/admin/registrar/DomainInformation/",
|
||||||
model=DomainInformation
|
model=DomainInformation,
|
||||||
)
|
)
|
||||||
|
|
||||||
# Create fake DomainInformation objects
|
# Create fake DomainInformation objects
|
||||||
|
@ -1017,14 +1029,10 @@ class DomainInformationAdminTest(TestCase):
|
||||||
self.client.login(username="superuser", password=p)
|
self.client.login(username="superuser", password=p)
|
||||||
|
|
||||||
# Assert that our sort works correctly
|
# Assert that our sort works correctly
|
||||||
self.test_helper.assert_table_sorted(
|
self.test_helper.assert_table_sorted("1", ("domain__name",))
|
||||||
"1", ("domain__name",)
|
|
||||||
)
|
|
||||||
|
|
||||||
# Assert that sorting in reverse works correctly
|
# Assert that sorting in reverse works correctly
|
||||||
self.test_helper.assert_table_sorted(
|
self.test_helper.assert_table_sorted("-1", ("-domain__name",))
|
||||||
"-1", ("-domain__name",)
|
|
||||||
)
|
|
||||||
|
|
||||||
def test_submitter_sortable(self):
|
def test_submitter_sortable(self):
|
||||||
"""Tests if DomainInformation sorts by submitter correctly"""
|
"""Tests if DomainInformation sorts by submitter correctly"""
|
||||||
|
@ -1054,7 +1062,7 @@ class UserDomainRoleAdminTest(TestCase):
|
||||||
user=self.superuser,
|
user=self.superuser,
|
||||||
admin=self.admin,
|
admin=self.admin,
|
||||||
url="/admin/registrar/UserDomainRole/",
|
url="/admin/registrar/UserDomainRole/",
|
||||||
model=UserDomainRole
|
model=UserDomainRole,
|
||||||
)
|
)
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue