forked from OCA/server-auth
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IMP] auth_signup_verify_email: black, isort, prettier
- Loading branch information
1 parent
b7a44b7
commit d8cda28
Showing
4 changed files
with
42 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
# Copyright 2016 Jairo Llopis <[email protected]> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from mock import patch | ||
from lxml.html import document_fromstring | ||
from mock import patch | ||
|
||
from odoo.tests.common import HttpCase | ||
from odoo.addons.mail.models import mail_template | ||
from odoo.tools.misc import mute_logger | ||
|
||
from odoo.addons.mail.models import mail_template | ||
|
||
|
||
class UICase(HttpCase): | ||
def setUp(self): | ||
super().setUp() | ||
if "website" in self.env: | ||
# Enable public signup in website if it is installed; otherwise | ||
# tests here would fail | ||
current_website = self.env['website'].get_current_website() | ||
current_website = self.env["website"].get_current_website() | ||
current_website.auth_signup_uninvited = "b2c" | ||
self.env["ir.config_parameter"].set_param( | ||
"auth_signup.invitation_scope", "b2c" | ||
) | ||
self.env["ir.config_parameter"].set_param("auth_signup.invitation_scope", "b2c") | ||
self.data = { | ||
"csrf_token": self.csrf_token(), | ||
"name": "Somebody", | ||
|
@@ -41,7 +41,7 @@ def test_bad_email(self): | |
doc = self.html_doc(data=self.data) | ||
self.assertTrue(doc.xpath('//p[@class="alert alert-danger"]')) | ||
|
||
@mute_logger('odoo.addons.auth_signup_verify_email.controllers.main') | ||
@mute_logger("odoo.addons.auth_signup_verify_email.controllers.main") | ||
def test_good_email(self): | ||
"""Test acceptance of good emails.""" | ||
self.data["login"] = "[email protected]" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,16 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<!-- Copyright 2016 Jairo Llopis <[email protected]> | ||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). --> | ||
<odoo> | ||
|
||
<template id="signup_fields" inherit_id="auth_signup.fields"> | ||
<xpath expr="//div[hasclass('field-password')]" | ||
position="attributes"> | ||
<attribute name="t-if">only_passwords</attribute> | ||
</xpath> | ||
<xpath expr="//div[hasclass('field-confirm_password')]" | ||
position="attributes"> | ||
<attribute name="t-if">only_passwords</attribute> | ||
</xpath> | ||
<xpath expr="//input[@name='login']" position="attributes"> | ||
<attribute name="type">email</attribute> | ||
</xpath> | ||
</template> | ||
|
||
<template id="signup_fields" inherit_id="auth_signup.fields"> | ||
<xpath expr="//div[hasclass('field-password')]" position="attributes"> | ||
<attribute name="t-if">only_passwords</attribute> | ||
</xpath> | ||
<xpath expr="//div[hasclass('field-confirm_password')]" position="attributes"> | ||
<attribute name="t-if">only_passwords</attribute> | ||
</xpath> | ||
<xpath expr="//input[@name='login']" position="attributes"> | ||
<attribute name="type">email</attribute> | ||
</xpath> | ||
</template> | ||
</odoo> |