Skip to content

Commit

Permalink
[ADD] Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
edescalona committed Dec 24, 2024
1 parent 76908bb commit 06da664
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions website_recaptcha_v2_form/tests/test_controller_form.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import json
from unittest import mock

from odoo import http
from odoo.tests import new_test_user
from odoo.tests.common import HttpCase

imp_requests = "odoo.addons.website_recaptcha_v2.models.website.requests"
from odoo.addons.web.controllers.home import SIGN_UP_REQUEST_PARAMS


class TestControllerForm(HttpCase):
Expand Down Expand Up @@ -37,8 +36,7 @@ def test_recaptcha_enabled_form(self):
response_recaptcha_not_enable = self.test_url_open(data={})
self.assertEqual(response_recaptcha_not_enable.status_code, 200)

@mock.patch(imp_requests)
def test_recaptcha_enabled_reset_password_login_signup(self, requests_mock):
def test_recaptcha_enabled_reset_password_login_signup(self):
new_test_user(self.env, login="test_user_form", password="Password!1")
self.authenticate("test_user_form", "Password!1")
data = {
Expand All @@ -56,3 +54,7 @@ def test_recaptcha_enabled_reset_password_login_signup(self, requests_mock):
)
response = self.test_url_open(url="/web/login", data=data)
self.assertEqual(response.status_code, 200)

SIGN_UP_REQUEST_PARAMS.add("confirm_password")
response = self.test_url_open(url="/web/login", data=data)
self.assertEqual(response.status_code, 200)

0 comments on commit 06da664

Please sign in to comment.