Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Fix tests for django-recaptcha
Unknown754925c40882
diff --git a/tests/test_account.py b/tests/test_account.pyindex 93891bf1ae..51e51c05dc 100644--- a/tests/test_account.py+++ b/tests/test_account.py@@ -6,6 +6,7 @@ from urllib.parse import urlencodeimport i18naddressimport pytestfrom captcha import constants as recaptcha_constants+from captcha.client import RecaptchaResponsefrom django.core.exceptions import ValidationErrorfrom django.forms import Formfrom django.http import QueryDict@@ -292,12 +293,14 @@ def test_disabled_recaptcha():assert form.is_valid()[email protected](os.environ, {'RECAPTCHA_TESTING': 'True'})-def test_requires_recaptcha(settings):+@patch('captcha.fields.client.submit')+def test_requires_recaptcha(captcha_submit_mock, settings):"""This test creates a new formthat should contain a (required) recaptcha field."""+ captcha_submit_mock.return_value = RecaptchaResponse(is_valid=True)+settings.RECAPTCHA_PUBLIC_KEY = recaptcha_constants.TEST_PUBLIC_KEYsettings.RECAPTCHA_PRIVATE_KEY = recaptcha_constants.TEST_PRIVATE_KEY