File tree Expand file tree Collapse file tree 2 files changed +2
-1
lines changed
snowpenguin/django/recaptcha3 Expand file tree Collapse file tree 2 files changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ def clean(self, values):
5454 if bool (json_response ['success' ]):
5555 if self ._score_threshold is not None and self ._score_threshold > json_response ['score' ]:
5656 raise ValidationError (
57- _ ('reCaptcha score is too low. score:%s' , json_response ['score' ])
57+ _ ('reCaptcha score is too low. score:%s' % json_response ['score' ])
5858 )
5959 return values [0 ]
6060 else :
Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ class RecaptchaTestForm(Form):
4141 recaptcha = ReCaptchaField (score_threshold = 0.7 )
4242 form = RecaptchaTestForm ({"g-recaptcha-response" : "dummy token" })
4343 self .assertFalse (form .is_valid ())
44+ self .assertEqual (form .errors ['recaptcha' ][0 ], 'reCaptcha score is too low. score:0.5' )
4445
4546 @mock .patch ('requests.post' )
4647 def test_validate_success_highter_score (self , requests_post ):
You can’t perform that action at this time.
0 commit comments