Skip to content

Commit

Permalink
feat: Update the Subscription factory to include g_recaptcha_response
Browse files Browse the repository at this point in the history
  • Loading branch information
kovalch committed Jul 2, 2024
1 parent 5589bc1 commit fe864e1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ckanext/switzerland/tests/test_subscription_emails.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,13 @@

class TestSubscriptionEmails(OgdchFunctionalTestBase):
def test_get_email_vars_with_subscription(self):
# Create a subscription with a valid reCAPTCHA response
subscription = factories.Subscription(
dataset_id=self.dataset['id'], return_object=True)
dataset_id=self.dataset['id'],
email='[email protected]',
g_recaptcha_response='valid-recaptcha-response',
return_object=True
)

subscribe = OgdchSubscribePlugin()
email_vars = subscribe.get_email_vars(
Expand All @@ -45,6 +50,7 @@ def test_get_email_vars_with_subscription(self):
assert_equal(email_vars['unsubscribe_link'],
'http://frontend-test.ckan.net/subscribe/unsubscribe?code=testcode&dataset={}'
.format(self.dataset['id']))
assert_equal(subscription.g_recaptcha_response, 'valid-recaptcha-response')

def test_get_email_vars_with_email(self):
subscribe = OgdchSubscribePlugin()
Expand Down

0 comments on commit fe864e1

Please sign in to comment.