Skip to content

Commit

Permalink
Remove deprecation warning for Django 4.0 in tests
Browse files Browse the repository at this point in the history
Stops the following warning:

RemovedInDjango40Warning: Passing None for the middleware get_response argument is deprecated
  • Loading branch information
hmpf committed Feb 29, 2024
1 parent 0fe59ef commit 3cc139d
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/integration/web/auth/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def session_request(db):
session_request = r.post('/anyurl')

# use middleware to make session for session_request
middleware = SessionMiddleware()
middleware = SessionMiddleware(lambda request: None)
middleware.process_request(session_request)
session_request.session.save()
return session_request
2 changes: 1 addition & 1 deletion tests/integration/web/auth/middleware_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def test_when_remote_user_logs_in_it_should_change_the_session_id(
with patch(
'nav.web.auth.remote_user.get_username', return_value=remote_account.login
):
middleware = AuthenticationMiddleware()
middleware = AuthenticationMiddleware(lambda request: None)
middleware.process_request(session_request)
assert session_request.account == remote_account
post_login_session_id = session_request.session.session_key
Expand Down
1 change: 0 additions & 1 deletion tests/integration/web/auth/sudo_test.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import pytest

from django.test import RequestFactory
from django.contrib.sessions.middleware import SessionMiddleware

from nav.web.auth.utils import set_account
from nav.web.auth.sudo import sudo, desudo
Expand Down

0 comments on commit 3cc139d

Please sign in to comment.