Skip to content

Commit

Permalink
add a value error unit test for when secret key in urlsafeserialzier …
Browse files Browse the repository at this point in the history
…is None
  • Loading branch information
Yuyuutsu committed Jan 26, 2024
1 parent c539ba3 commit 7a65457
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/app/helpers/test_url_safe_serializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,9 @@ def test_safe_serializer_raises_bad_signature_when_salts_differ(app: Flask):

with pytest.raises(BadSignature):
url_safe_serializer().loads(serialized_param)

def test_safe_serializer_raises_value_error_when_secret_key_is_none(app:Flask):
app.secret_key = None
with app.test_request_context():
with pytest.raises(ValueError):
url_safe_serializer()

0 comments on commit 7a65457

Please sign in to comment.