Skip to content

Commit

Permalink
[IMP] Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
edescalona committed Dec 23, 2024
1 parent 34ab7a1 commit 7b7affd
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 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,9 @@
from odoo.tests import new_test_user
from odoo.tests.common import HttpCase

from website.website_recaptcha_v2_form.controllers.form import WebsiteRecaptchaForm
from website.website_recaptcha_v2_form.controllers.main import RecaptchaHome


class TestControllerForm(HttpCase):
def test_url_open(self, data=None, url="/website/form/res.partner"):
Expand All @@ -30,6 +33,7 @@ def test_recaptcha_enabled_form(self):
data={"recaptcha_enabled": False}
)
self.assertEqual(response_recaptcha_not_enable.status_code, 200)
self.assertEqual(response_recaptcha_not_enable, WebsiteRecaptchaForm)

def test_recaptcha_enabled_reset_password_login_signup(self):
new_test_user(self.env, login="test_user", password="Password!1")
Expand All @@ -50,3 +54,6 @@ 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)

response = self.test_url_open(url="/web/signup", data=data)
self.assertEqual(response, RecaptchaHome)

0 comments on commit 7b7affd

Please sign in to comment.