Skip to content

Django 4 support #52

@jayvdb

Description

@jayvdb

For tests are failing instantiating middleware: TypeError: __init__() missing 1 required positional argument: 'get_response'

[   37s] ______ MessagesAssertionsMixin.test_assert_messages_sent_when_really_sent ______
[   37s] 
[   37s] self = <testproject.testapp.tests.test_assertions.MessagesAssertionsMixin testMethod=test_assert_messages_sent_when_really_sent>
[   37s] 
[   37s]     def test_assert_messages_sent_when_really_sent(self):
[   37s]         request = self.factory.get(data={'send': '3'})
[   37s]     
[   37s] >       self.view(request)
[   37s] 
[   37s] testapp/tests/test_assertions.py:132: 
[   37s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   37s] ../djet/testcases.py:62: in view
[   37s]     self._load_middleware()
[   37s] ../djet/testcases.py:88: in _load_middleware
[   37s]     self._load_old_middleware()
[   37s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   37s] 
[   37s] self = <testproject.testapp.tests.test_assertions.MessagesAssertionsMixin testMethod=test_assert_messages_sent_when_really_sent>
[   37s] 
[   37s]     def _load_old_middleware(self):
[   37s]         middleware_classes = self.middleware_classes or []
[   37s]         for mw_class in middleware_classes:
[   37s]             mw_class, mw_types = self._unpack_middleware(mw_class)
[   37s] >           mw_instance = mw_class()
[   37s] E           TypeError: __init__() missing 1 required positional argument: 'get_response'
[   37s] 
[   37s] ../djet/testcases.py:96: TypeError
[   37s] =============================== warnings summary ===============================
[   37s] ../../../../../../usr/lib/python3.9/site-packages/django/conf/__init__.py:199
[   37s]   /usr/lib/python3.9/site-packages/django/conf/__init__.py:199: RemovedInDjango50Warning: The default value of USE_TZ will change from False to True in Django 5.0. Set USE_TZ to False in your project settings if you want to keep the current default behavior.
[   37s]     warnings.warn(
[   37s] 
[   37s] -- Docs: https://docs.pytest.org/en/stable/warnings.html
[   37s] =========================== short test summary info ============================
[   37s] FAILED testapp/tests/test_assertions.py::MessagesAssertionsMixin::test_assert_messages_passes_when_matched_message
[   37s] FAILED testapp/tests/test_assertions.py::MessagesAssertionsMixin::test_assert_messages_raise_assertion_error_when_no_matching_message
[   37s] FAILED testapp/tests/test_assertions.py::MessagesAssertionsMixin::test_assert_messages_sent_when_not_sent
[   37s] FAILED testapp/tests/test_assertions.py::MessagesAssertionsMixin::test_assert_messages_sent_when_really_sent

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions