-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Remove recaptcha tests from test
- Loading branch information
Showing
2 changed files
with
1 addition
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
) | ||
|
||
|