mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-15 17:17:02 +02:00
linter
This commit is contained in:
parent
4adeb6722b
commit
9c8ed1682b
4 changed files with 10 additions and 10 deletions
|
@ -67,7 +67,7 @@ class OpenIdConnectBackend(ModelBackend):
|
||||||
def update_existing_user(self, user, kwargs):
|
def update_existing_user(self, user, kwargs):
|
||||||
"""Update other fields without overwriting first_name and last_name.
|
"""Update other fields without overwriting first_name and last_name.
|
||||||
Overwrite first_name and last_name if not empty string"""
|
Overwrite first_name and last_name if not empty string"""
|
||||||
|
|
||||||
for key, value in kwargs.items():
|
for key, value in kwargs.items():
|
||||||
# Check if the key is not first_name or last_name or value is not empty string
|
# Check if the key is not first_name or last_name or value is not empty string
|
||||||
if key not in ["first_name", "last_name"] or value:
|
if key not in ["first_name", "last_name"] or value:
|
||||||
|
|
|
@ -406,8 +406,8 @@ def mock_user():
|
||||||
"""A simple user."""
|
"""A simple user."""
|
||||||
user_kwargs = dict(
|
user_kwargs = dict(
|
||||||
id=4,
|
id=4,
|
||||||
first_name="Rachid",
|
first_name="Jeff",
|
||||||
last_name="Mrad",
|
last_name="Lebowski",
|
||||||
)
|
)
|
||||||
mock_user, _ = User.objects.get_or_create(**user_kwargs)
|
mock_user, _ = User.objects.get_or_create(**user_kwargs)
|
||||||
return mock_user
|
return mock_user
|
||||||
|
|
|
@ -1021,7 +1021,7 @@ class ListHeaderAdminTest(TestCase):
|
||||||
# Set the GET parameters for testing
|
# Set the GET parameters for testing
|
||||||
request.GET = {
|
request.GET = {
|
||||||
"status": "started",
|
"status": "started",
|
||||||
"investigator": "Rachid Mrad",
|
"investigator": "Jeff Lebowski",
|
||||||
"q": "search_value",
|
"q": "search_value",
|
||||||
}
|
}
|
||||||
# Call the get_filters method
|
# Call the get_filters method
|
||||||
|
@ -1032,7 +1032,7 @@ class ListHeaderAdminTest(TestCase):
|
||||||
filters,
|
filters,
|
||||||
[
|
[
|
||||||
{"parameter_name": "status", "parameter_value": "started"},
|
{"parameter_name": "status", "parameter_value": "started"},
|
||||||
{"parameter_name": "investigator", "parameter_value": "Rachid Mrad"},
|
{"parameter_name": "investigator", "parameter_value": "Jeff Lebowski"},
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -659,7 +659,7 @@ class TestUser(TestCase):
|
||||||
class TestContact(TestCase):
|
class TestContact(TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.email = "mayor@igorville.gov"
|
self.email = "mayor@igorville.gov"
|
||||||
self.user, _ = User.objects.get_or_create(email=self.email, first_name="Rachid", last_name="Mrad")
|
self.user, _ = User.objects.get_or_create(email=self.email, first_name="Jeff", last_name="Lebowski")
|
||||||
self.contact, _ = Contact.objects.get_or_create(user=self.user)
|
self.contact, _ = Contact.objects.get_or_create(user=self.user)
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
|
@ -670,10 +670,10 @@ class TestContact(TestCase):
|
||||||
def test_saving_contact_updates_user_first_last_names(self):
|
def test_saving_contact_updates_user_first_last_names(self):
|
||||||
"""When a contact is updated, we propagate the changes to the linked user if it exists."""
|
"""When a contact is updated, we propagate the changes to the linked user if it exists."""
|
||||||
# User and Contact are created and linked as expected
|
# User and Contact are created and linked as expected
|
||||||
self.assertEqual(self.contact.first_name, "Rachid")
|
self.assertEqual(self.contact.first_name, "Jeff")
|
||||||
self.assertEqual(self.contact.last_name, "Mrad")
|
self.assertEqual(self.contact.last_name, "Lebowski")
|
||||||
self.assertEqual(self.user.first_name, "Rachid")
|
self.assertEqual(self.user.first_name, "Jeff")
|
||||||
self.assertEqual(self.user.last_name, "Mrad")
|
self.assertEqual(self.user.last_name, "Lebowski")
|
||||||
|
|
||||||
self.contact.first_name = "Joey"
|
self.contact.first_name = "Joey"
|
||||||
self.contact.last_name = "Baloney"
|
self.contact.last_name = "Baloney"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue