Skip to content

Commit

Permalink
fix: Remove recaptcha tests from test
Browse files Browse the repository at this point in the history
  • Loading branch information
kovalch committed Jul 4, 2024
1 parent 671711c commit 96f616b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
1 change: 0 additions & 1 deletion ckanext/switzerland/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
15 changes: 1 addition & 14 deletions ckanext/switzerland/tests/test_subscription_emails.py
Original file line number Diff line number Diff line change
Expand Up @@ -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='[email protected]',
g_recaptcha_response=self.dataset['g_recaptcha_response'],
return_object=True
)

Expand Down

0 comments on commit 96f616b

Please sign in to comment.