tests: Add a dummy parameter for middlewares

From the Django 4.0 release notes: The get_response argument for
django.utils.deprecation.MiddlewareMixin.__init__() is required and
doesn’t accept None.

It appears that any non-None value can be used here, so I pass in
`True` when initializing middlewares for tests. I don't know if this
was the intended value, but it does fix the tests.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
James Valleroy 2022-06-20 08:13:21 -04:00 committed by Sunil Mohan Adapa
parent 2a0239b6ba
commit b43e42ac7a
No known key found for this signature in database
GPG Key ID: 43EA1CFF0AA7C5F2

View File

@ -55,7 +55,7 @@ class TestSetupMiddleware:
@pytest.fixture(name='middleware')
def fixture_middleware(load_cfg):
"""Fixture for returning middleware."""
return SetupMiddleware()
return SetupMiddleware(True)
@staticmethod
@patch('django.urls.reverse', return_value='users:login')
@ -187,7 +187,7 @@ class TestAdminMiddleware:
@pytest.fixture(name='middleware')
def fixture_middleware(load_cfg):
"""Fixture for returning middleware."""
return AdminRequiredMiddleware()
return AdminRequiredMiddleware(True)
@staticmethod
@pytest.fixture(name='web_request')