diff --git a/.gitignore b/.gitignore index 7f7af7f0..031d78ef 100644 --- a/.gitignore +++ b/.gitignore @@ -69,4 +69,5 @@ config.yaml /py2/ /py38/ /py39/ +/py39b/ /django2/ diff --git a/rowers/tests/test_simplefunctions.py b/rowers/tests/test_simplefunctions.py index 155efefb..59753174 100644 --- a/rowers/tests/test_simplefunctions.py +++ b/rowers/tests/test_simplefunctions.py @@ -6,6 +6,7 @@ from __future__ import unicode_literals from .statements import * from django.http import Http404 +from django_recaptcha.client import RecaptchaResponse from rowers.views import get_workout @@ -69,7 +70,10 @@ class SimpleViewTest(TestCase): response = self.c.get(url) self.assertIn(response.status_code, [403, 404]) - def test_sendmail(self): + @patch("django_recaptcha.fields.client.submit") + def test_sendmail(self, mocked_submit): + mocked_submit.return_value = RecaptchaResponse(is_valid=True, extra_data={"score":0.95}) + login = self.c.login(username=self.u.username, password=self.password) self.assertTrue(login) @@ -80,18 +84,20 @@ class SimpleViewTest(TestCase): 'lastname': 'Doe', 'email': 'roosendaalsander@gmail.com', 'subject': 'testing', - 'botcheck': True, + 'captcha': 'sdsdsdsdsdsdss', + 'g-recaptcha-response': 'PASSED', 'message': faker.text()} form = EmailForm(form_data) + self.assertTrue(form.is_valid()) response = self.c.post(url, form_data, follow=True) self.assertEqual(response.status_code, 200) self.assertRedirects(response, - expected_url='/rowers/email/', + expected_url='/rowers/email/thankyou/', status_code=302, target_status_code=200) def test_getworkout(self): diff --git a/rowers/tests/testdata/testdata.tcx.gz b/rowers/tests/testdata/testdata.tcx.gz index f698047b..4f556076 100644 Binary files a/rowers/tests/testdata/testdata.tcx.gz and b/rowers/tests/testdata/testdata.tcx.gz differ diff --git a/rowers/tests/viewnames.csv b/rowers/tests/viewnames.csv index 245dbb17..0c19b5c5 100644 --- a/rowers/tests/viewnames.csv +++ b/rowers/tests/viewnames.csv @@ -134,7 +134,7 @@ 175,220,rower_favoritecharts_view,See favorite charts,TRUE,302,pro,200,302,pro,403,403,coach,200,403,FALSE,TRUE,FALSE,TRUE,TRUE, 176,222,workout_workflow_config2_view,configure workflow,TRUE,302,basic,200,302,basic,403,403,coach,200,403,FALSE,TRUE,FALSE,FALSE,FALSE, 177,224,workflow_default_view,resets workflow to default,TRUE,302,basic,302,302,FALSE,403,403,FALSE,302,403,FALSE,FALSE,FALSE,TRUE,TRUE, -178,225,sendmail,feedback form,TRUE,302,basic,302,302,FALSE,200,302,FALSE,200,302,FALSE,FALSE,FALSE,TRUE,TRUE, +178,225,sendmail,feedback form,TRUE,200,basic,200,302,FALSE,200,302,FALSE,200,302,FALSE,FALSE,FALSE,TRUE,TRUE, 180,232,laboratory_view,lab,TRUE,302,basic,200,302,basic,403,403,coach,200,403,FALSE,TRUE,FALSE,TRUE,TRUE, 181,233,errormessage_view,not used,TRUE,200,basic,200,302,basic,200,302,coach,200,302,FALSE,FALSE,FALSE,FALSE,FALSE, 182,237,payment_confirm_view,confirm payment,TRUE,200,basic,200,302,basic,200,302,coach,200,302,FALSE,FALSE,FALSE,FALSE,FALSE,