Browse Source

Merge pull request #1184 from Tecnativa/10.0-auth_signup_verify_email-fix_integration_tests

[FIX] auth_signup_verify_email: Better integration tests
pull/1189/head
Pedro M. Baeza 7 years ago
committed by GitHub
parent
commit
dd8f0a5f5b
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 25
      auth_signup_verify_email/tests/test_verify_email.py

25
auth_signup_verify_email/tests/test_verify_email.py

@ -5,20 +5,18 @@
from urllib import urlencode from urllib import urlencode
from lxml.html import document_fromstring from lxml.html import document_fromstring
from openerp import _ from openerp import _
from openerp.tests.common import HttpCase
from openerp.tests.common import at_install, post_install, HttpCase
@at_install(False)
@post_install(True)
class UICase(HttpCase): class UICase(HttpCase):
def setUp(self): def setUp(self):
super(UICase, self).setUp() super(UICase, self).setUp()
self.icp = self.env["ir.config_parameter"]
self.old_allow_uninvited = self.icp.get_param(
"auth_signup.allow_uninvited")
self.icp.set_param("auth_signup.allow_uninvited", "True")
# Workaround https://github.com/odoo/odoo/issues/12237
self.cr.commit()
with self.cursor() as http_cr:
http_env = self.env(http_cr)
http_env["ir.config_parameter"].set_param(
"auth_signup.allow_uninvited", "True")
self.data = { self.data = {
"csrf_token": self.csrf_token(), "csrf_token": self.csrf_token(),
"name": "Somebody", "name": "Somebody",
@ -30,14 +28,7 @@ class UICase(HttpCase):
"success": _("Check your email to activate your account!"), "success": _("Check your email to activate your account!"),
} }
def tearDown(self):
"""Workaround https://github.com/odoo/odoo/issues/12237."""
super(UICase, self).tearDown()
self.icp.set_param(
"auth_signup.allow_uninvited", self.old_allow_uninvited)
self.cr.commit()
def html_doc(self, url="/web/signup", data=None, timeout=10):
def html_doc(self, url="/web/signup", data=None, timeout=30):
"""Get an HTML LXML document.""" """Get an HTML LXML document."""
if data: if data:
data = bytes(urlencode(data)) data = bytes(urlencode(data))

Loading…
Cancel
Save