We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b691ae5 commit ac43fd3Copy full SHA for ac43fd3
1 file changed
tests/test_oidc.py
@@ -31,13 +31,9 @@ def test_pkce_code_verifier_respects_custom_length(self):
31
32
def test_pkce_code_verifier_can_have_repeated_characters(self):
33
"""secrets.choice() samples with replacement, unlike the old random.sample()."""
34
- seen_repeat = False
35
- for _ in range(100):
36
- result = _generate_pkce_code_verifier(128)
37
- if len(set(result["code_verifier"])) < len(result["code_verifier"]):
38
- seen_repeat = True
39
- break
40
- self.assertTrue(seen_repeat,
+ result = _generate_pkce_code_verifier(128)
+ code_verifier = result["code_verifier"]
+ self.assertLess(len(set(code_verifier)), len(code_verifier),
41
"At length 128 with a 66-char alphabet, repeated chars are expected")
42
43
def test_pkce_code_verifier_is_not_deterministic(self):
0 commit comments