Skip to content

Commit 98871af

Browse files
author
Vasyl Dizhak
committed
#646, fix skip tests for the django.contrib.sessions.serializers.PickleSerializer for django > 4.2
1 parent 2ba6b15 commit 98871af

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tests/test_session.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
import base64
2+
3+
import django
4+
import pytest
5+
26
import unittest
37
from datetime import timedelta
48
from typing import Optional, Type
@@ -300,7 +304,6 @@ def test_decode_failure_logged_to_security(self):
300304
self.assertEqual({}, self.session.decode(bad_encode))
301305
# The failed decode is logged.
302306
self.assertIn("corrupted", cm.output[0])
303-
304307
def test_actual_expiry(self):
305308
# this doesn't work with JSONSerializer (serializing timedelta)
306309
with override_settings(
@@ -365,6 +368,10 @@ def test_session_save_does_not_resurrect_session_logged_out_in_other_context(sel
365368
class SessionTests(SessionTestsMixin, unittest.TestCase):
366369
backend = CacheSession
367370

371+
@pytest.mark.skipif(
372+
django.VERSION > (4, 2),
373+
reason="PickleSerializer is removed as of https://code.djangoproject.com/ticket/29708"
374+
)
368375
def test_actual_expiry(self):
369376
if isinstance(
370377
caches[DEFAULT_CACHE_ALIAS].client._serializer, MSGPackSerializer

0 commit comments

Comments
 (0)