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 20, 2023
1 parent d27ba54 commit bb1979d
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions auditlog_tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1159,7 +1159,10 @@ def test_register_from_settings_invalid_settings(self):
):
self.test_auditlog.register_from_settings()

with override_settings(AUDITLOG_INCLUDE_ALL_MODELS=True, AUDITLOG_EXCLUDE_TRACKING_FIELDS="badvalue"):
with override_settings(
AUDITLOG_INCLUDE_ALL_MODELS=True,
AUDITLOG_EXCLUDE_TRACKING_FIELDS="badvalue",
):
with self.assertRaisesMessage(
TypeError,
"Setting 'AUDITLOG_EXCLUDE_TRACKING_FIELDS' must be a list or tuple",
Expand Down Expand Up @@ -1239,11 +1242,19 @@ def test_register_from_settings_register_all_models_with_exclude_models_tuple(se
AUDITLOG_INCLUDE_ALL_MODELS=True,
AUDITLOG_EXCLUDE_TRACKING_FIELDS=("datetime",),
)
def test_register_from_settings_register_all_models_with_exclude_tracking_fields(self):
def test_register_from_settings_register_all_models_with_exclude_tracking_fields(
self,
):
self.test_auditlog.register_from_settings()

self.assertEqual(self.test_auditlog.get_model_fields(SimpleModel)['exclude_fields'], ['datetime'])
self.assertEqual(self.test_auditlog.get_model_fields(AltPrimaryKeyModel)['exclude_fields'], ['datetime'])
self.assertEqual(
self.test_auditlog.get_model_fields(SimpleModel)["exclude_fields"],
["datetime"],
)
self.assertEqual(
self.test_auditlog.get_model_fields(AltPrimaryKeyModel)["exclude_fields"],
["datetime"],
)

@override_settings(
AUDITLOG_INCLUDE_ALL_MODELS=True,
Expand Down

0 comments on commit bb1979d

Please sign in to comment.