Skip to content

Commit

Permalink
fix OrderedDict initialization for python <3.6
Browse files Browse the repository at this point in the history
I am surprised how unintuitively hard it is to get this right.
  • Loading branch information
nigoroll committed Apr 23, 2020
1 parent d722090 commit 77496d6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/views/test_authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ def test_keys_with_key_id(
api_settings, "JWT_PUBLIC_KEY", rsa_keys["public"]
)

secret_key = OrderedDict(hash1="one", hash2="two")
secret_key = OrderedDict([("hash1", "one"), ("hash2", "two")])
monkeypatch.setattr(api_settings, "JWT_SECRET_KEY", secret_key)

for kid, algo in {"hash1": ["HS256", "RS256"], "rsa1": ["RS256", "HS256"]}.items():
Expand All @@ -303,7 +303,7 @@ def test_keys_key_id_not_found(
monkeypatch, user, call_auth_endpoint
):

secret_key = OrderedDict(hash1="one", hash2="two")
secret_key = OrderedDict([("hash1", "one"), ("hash2", "two")])
monkeypatch.setattr(api_settings, "JWT_SECRET_KEY", secret_key)

response = call_auth_endpoint("username", "password")
Expand Down

0 comments on commit 77496d6

Please sign in to comment.