Browse Source

[FIX] auth_signup_verify_email: Better integration tests

- Remove commits in tests.
- Bigger timeout.
- Run at post-install, since partners are created, which easily leads to `ProgrammingError`s.
pull/1184/head
Jairo Llopis 7 years ago
parent
commit
ca4e088448
  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 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))

Loading…
Cancel
Save