Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jan 25, 2024
1 parent 6d15191 commit 60c006d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
9 changes: 3 additions & 6 deletions simple_history/tests/tests/test_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -790,8 +790,7 @@ def test_history_view_sets_admin_user_view(self):

user_model = get_user_model()
admin_user_view = "admin:{}_{}_change".format(
user_model._meta.app_label,
user_model._meta.model_name
user_model._meta.app_label, user_model._meta.model_name
)
context = {
"title": admin.history_view_title(request, poll),
Expand Down Expand Up @@ -833,8 +832,7 @@ def test_history_view_sets_admin_user_view_on_user_model_override(self):

user_model = BucketMember
admin_user_view = "admin:{}_{}_change".format(
user_model._meta.app_label,
user_model._meta.model_name
user_model._meta.app_label, user_model._meta.model_name
)
context = {
"title": admin.history_view_title(request, bucket_data),
Expand Down Expand Up @@ -875,8 +873,7 @@ def test_history_view_sets_admin_user_view_on_custom_user_id_field(self):

user_model = get_user_model()
admin_user_view = "admin:{}_{}_change".format(
user_model._meta.app_label,
user_model._meta.model_name
user_model._meta.app_label, user_model._meta.model_name
)
context = {
"title": admin.history_view_title(request, instance),
Expand Down
15 changes: 9 additions & 6 deletions simple_history/tests/tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -600,20 +600,20 @@ def test_model_with_excluded_fields(self):

def test_history_user_model_is_auth_user_as_default(self):
self.assertEqual(
get_user_model(),
get_history_model_for_model(Poll)._history_user_model
get_user_model(), get_history_model_for_model(Poll)._history_user_model
)

def test_history_user_model_is_user_model_on_override(self):
self.assertEqual(
BucketMember,
get_history_model_for_model(BucketData)._history_user_model
BucketMember, get_history_model_for_model(BucketData)._history_user_model
)

def test_history_user_model_is_user_model_on_override_register(self):
self.assertEqual(
BucketMember,
get_history_model_for_model(BucketDataRegisterChangedBy)._history_user_model
get_history_model_for_model(
BucketDataRegisterChangedBy
)._history_user_model,
)

def test_user_model_override(self):
Expand Down Expand Up @@ -2313,9 +2313,12 @@ def test_history_user_does_not_exist(self):
def test_history_user_model_is_auth_user(self):
self.assertEqual(
get_user_model(),
get_history_model_for_model(ExternalModelWithCustomUserIdField)._history_user_model
get_history_model_for_model(
ExternalModelWithCustomUserIdField
)._history_user_model,
)


class RelatedNameTest(TestCase):
def setUp(self):
self.user_one = get_user_model().objects.create( # nosec
Expand Down

0 comments on commit 60c006d

Please sign in to comment.