Skip to content

Commit

Permalink
#646, fix skip tests for the django.contrib.sessions.serializers.Pick…
Browse files Browse the repository at this point in the history
…leSerializer for django > 4.2
  • Loading branch information
Vasyl Dizhak committed Jan 20, 2023
1 parent 2ba6b15 commit 98871af
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tests/test_session.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import base64

import django
import pytest

import unittest
from datetime import timedelta
from typing import Optional, Type
Expand Down Expand Up @@ -300,7 +304,6 @@ def test_decode_failure_logged_to_security(self):
self.assertEqual({}, self.session.decode(bad_encode))
# The failed decode is logged.
self.assertIn("corrupted", cm.output[0])

def test_actual_expiry(self):
# this doesn't work with JSONSerializer (serializing timedelta)
with override_settings(
Expand Down Expand Up @@ -365,6 +368,10 @@ def test_session_save_does_not_resurrect_session_logged_out_in_other_context(sel
class SessionTests(SessionTestsMixin, unittest.TestCase):
backend = CacheSession

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

0 comments on commit 98871af

Please sign in to comment.