Skip to content

Commit

Permalink
[ADD] Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
edescalona committed Dec 23, 2024
1 parent d171986 commit c8eccd9
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions website_recaptcha_v2_form/tests/test_controller_form.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
from odoo.tests import new_test_user
from odoo.tests.common import HttpCase

from odoo.addons.website_recaptcha_v2_form.controllers.main import RecaptchaHome


class TestControllerForm(HttpCase):
def test_url_open(self, data=None, url="/website/form/res.partner"):
Expand Down Expand Up @@ -50,3 +52,15 @@ def test_recaptcha_enabled_reset_password_login_signup(self):
)
response = self.test_url_open(url="/web/login", data=data)
self.assertEqual(response.status_code, 200)

def test_verify_recaptcha_v2_with_template(self):
values = {"g-recaptcha-response": "dummy_response"}
result = RecaptchaHome.verify_recaptcha_v2(
self, template="auth_signup.signup", values=values
)
self.assertTrue(result)

result = RecaptchaHome.verify_recaptcha_v2(
self, template="auth_signup.reset_password", values=values
)
self.assertTrue(result)

0 comments on commit c8eccd9

Please sign in to comment.