From 5fbb4d0dd168f90d74cd3dfeca96b2767aa4b275 Mon Sep 17 00:00:00 2001 From: Luke Borwell <51922453+lborwell-travelperk@users.noreply.github.com> Date: Tue, 11 Apr 2023 17:19:37 +0200 Subject: [PATCH] Fix RemovedInDjango41Warning --- auditlog/__init__.py | 2 -- auditlog_tests/__init__.py | 1 - auditlog_tests/tests.py | 4 +++- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/auditlog/__init__.py b/auditlog/__init__.py index e96d652d..50e82385 100644 --- a/auditlog/__init__.py +++ b/auditlog/__init__.py @@ -5,5 +5,3 @@ except DistributionNotFound: # package is not installed pass - -default_app_config = "auditlog.apps.AuditlogConfig" diff --git a/auditlog_tests/__init__.py b/auditlog_tests/__init__.py index fa615123..e69de29b 100644 --- a/auditlog_tests/__init__.py +++ b/auditlog_tests/__init__.py @@ -1 +0,0 @@ -default_app_config = "auditlog_tests.apps.AuditlogTestConfig" diff --git a/auditlog_tests/tests.py b/auditlog_tests/tests.py index d75afbe7..41d71f59 100644 --- a/auditlog_tests/tests.py +++ b/auditlog_tests/tests.py @@ -1,5 +1,6 @@ import datetime import json +from unittest import mock import django from dateutil.tz import gettz @@ -182,7 +183,8 @@ class MiddlewareTest(TestCase): """ def setUp(self): - self.middleware = AuditlogMiddleware() + self.get_response_mock = mock.Mock() + self.middleware = AuditlogMiddleware(get_response=self.get_response_mock) self.factory = RequestFactory() self.user = User.objects.create_user( username="test", email="test@example.com", password="top_secret"