Skip to content

Commit dfac233

Browse files
committed
Use PickleSerializer to serialize test sessions.
Use PickleSerializer so that we can serialize datetimes in sessions (this is necessary to set expired sessions in automated tests). See https://docs.djangoproject.com/en/2.0/topics/http/sessions/#write-your-own-serializer.
1 parent 0db2377 commit dfac233

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tests/tests.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
class CleanupTest(TestCase):
1313
@override_settings(SESSION_ENGINE="django.contrib.sessions.backends.file")
14+
@override_settings(SESSION_SERIALIZER="django.contrib.sessions.serializers.PickleSerializer") # noqa: E501
1415
def test_session_cleanup(self):
1516
"""
1617
Tests that sessions are deleted by the task

0 commit comments

Comments
 (0)