Skip to content

Commit

Permalink
fix: Add additional class for recaptcha
Browse files Browse the repository at this point in the history
  • Loading branch information
kovalch committed Jul 2, 2024
1 parent 2a2833e commit 9993af1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion ckanext/subscribe/tests/test_action.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import mock
from ckan import model
import ckan.plugins.toolkit as tk
from ckan.plugins.toolkit import ValidationError
from ckan.tests import factories, helpers
from nose.tools import assert_equal as eq
Expand Down Expand Up @@ -223,7 +224,13 @@ def test_dataset_and_group_at_same_time(self, send_request_email):

assert not send_request_email.called

# The reCAPTCHA tests

# The reCAPTCHA tests
class TestRecaptchaOfSubscribeSignup(object):
def setup(self):
helpers.reset_db()
tk.config["ckanext.subscribe.apply_recaptcha"] = "true"

# mock the _verify_recaptcha function and test both
# successful and unsuccessful reCAPTCHA verification scenarios
@mock.patch("requests.post")
Expand Down
2 changes: 1 addition & 1 deletion test.ini
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use = config:../ckan/test-core.ini
# Insert any custom config settings to be used when running your extension's
# tests here.
ckan.plugins = subscribe
ckanext.subscribe.apply_recaptcha = true
ckanext.subscribe.apply_recaptcha = false
ckanext.subscribe.recaptcha.api_url = https://www.google.com/recaptcha/api/siteverify
#ckanext.subscribe.recaptcha.privatekey =
#ckanext.subscribe.recaptcha.publickey =
Expand Down

0 comments on commit 9993af1

Please sign in to comment.