Skip to content

Commit

Permalink
Test explicit pickle serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
Schnouki committed Sep 3, 2024
1 parent 61b7abe commit d0ed44d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/test_cookie.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import datetime
import json
import pickle

from werkzeug.http import parse_cookie
from werkzeug.wrappers import Request
Expand Down Expand Up @@ -86,3 +87,12 @@ class JSONSecureCookie(SecureCookie):
secure = JSONSecureCookie({"foo": "bar"}, "secret").serialize()
data = JSONSecureCookie.unserialize(secure, "secret")
assert data == {"foo": "bar"}


def test_pickle():
class PickleSecureCookie(SecureCookie):
serialization_method = pickle

secure = PickleSecureCookie({"foo": "bar"}, "secret").serialize()
data = PickleSecureCookie.unserialize(secure, "secret")
assert data == {"foo": "bar"}

0 comments on commit d0ed44d

Please sign in to comment.