From 6da5cddabbb3099659341b6a95f51564b55f4f81 Mon Sep 17 00:00:00 2001 From: Tessa Alexander Date: Fri, 14 Jul 2023 14:13:34 +0100 Subject: [PATCH] Add test hcaptcha repsonse to test regiatration test --- tests/base_test_case.py | 1 + tests/test_access.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/base_test_case.py b/tests/base_test_case.py index 11e5f9e2..8fd5759c 100644 --- a/tests/base_test_case.py +++ b/tests/base_test_case.py @@ -11,6 +11,7 @@ def setUp(self): """Override set up to create test users of each Django default role type.""" super(BaseTestCase, self).setUp() self.client = Client() + self.hcaptcha_response = "10000000-aaaa-bbbb-cccc-000000000001" self.user = User.objects.create_user(id=999, username='may', email='may@example.com', diff --git a/tests/test_access.py b/tests/test_access.py index 6636ff75..6191a6d3 100644 --- a/tests/test_access.py +++ b/tests/test_access.py @@ -73,7 +73,8 @@ def test_register_page(self): {"username": "testuser1", "email": "bob@example.com", "password1": "THISISJUSTATEST", - "password2": "THISISJUSTATEST"}, + "password2": "THISISJUSTATEST", + "h-captcha-response": self.hcaptcha_response}, follow=True) self.assertContains(response, "Your registration is complete.", msg_prefix=str(response.content))