|
|
@ -5,20 +5,18 @@ |
|
|
|
from urllib import urlencode |
|
|
|
from lxml.html import document_fromstring |
|
|
|
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): |
|
|
|
def setUp(self): |
|
|
|
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 = { |
|
|
|
"csrf_token": self.csrf_token(), |
|
|
|
"name": "Somebody", |
|
|
@ -30,14 +28,7 @@ class UICase(HttpCase): |
|
|
|
"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.""" |
|
|
|
if data: |
|
|
|
data = bytes(urlencode(data)) |
|
|
|