diff --git a/ckanext/switzerland/tests/__init__.py b/ckanext/switzerland/tests/__init__.py index 1541f023..cf1f8e5d 100644 --- a/ckanext/switzerland/tests/__init__.py +++ b/ckanext/switzerland/tests/__init__.py @@ -69,6 +69,5 @@ def setup(self): 'url': 'http://some_url', 'owner_org': 'test-org', 'identifier': 'test@test-org', - 'g_recaptcha_response': 'valid-recaptcha-response', } self.dataset = tk.get_action('package_create')(context, self.dataset_dict) diff --git a/ckanext/switzerland/tests/test_subscription_emails.py b/ckanext/switzerland/tests/test_subscription_emails.py index 6769adff..b184bca9 100644 --- a/ckanext/switzerland/tests/test_subscription_emails.py +++ b/ckanext/switzerland/tests/test_subscription_emails.py @@ -21,24 +21,11 @@ class TestSubscriptionEmails(OgdchFunctionalTestBase): - # Mock the _verify_recaptcha function - @mock.patch("requests.post") - @mock.patch("ckanext.subscribe.email_verification.send_request_email") - @mock.patch("ckanext.subscribe.action._verify_recaptcha") - def test_get_email_vars_with_subscription( - self, mock_verify_recaptcha, send_request_email, mock_post - ): - # Mocking the reCAPTCHA verification to return True - mock_verify_recaptcha.return_value = True - mock_post.return_value = mock.Mock( - status_code=200, json=lambda: {"success": True} - ) + def test_get_email_vars_with_subscription(self): - # Create a subscription with a valid reCAPTCHA response subscription = factories.Subscription( dataset_id=self.dataset['id'], email='bob@example.com', - g_recaptcha_response=self.dataset['g_recaptcha_response'], return_object=True )