Skip to content

Commit

Permalink
Merge pull request OCA#271 from OCA/10.0
Browse files Browse the repository at this point in the history
Syncing from upstream OCA/server-tools (10.0)
  • Loading branch information
bt-admin authored May 23, 2018
2 parents e0b857d + 76e0836 commit 9efb951
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 25 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ addon | version | summary
[attachment_base_synchronize](attachment_base_synchronize/) | 10.0.1.0.0 | Attachment Base Synchronize
[auditlog](auditlog/) | 10.0.1.0.0 | Audit Log
[auth_admin_passkey](auth_admin_passkey/) | 10.0.1.0.0 | Authentification - Admin Passkey
[auth_brute_force](auth_brute_force/) | 10.0.2.1.0 | Track Authentication Attempts and Prevent Brute-force Attacks
[auth_brute_force](auth_brute_force/) | 10.0.2.1.1 | Track Authentication Attempts and Prevent Brute-force Attacks
[auth_session_timeout](auth_session_timeout/) | 10.0.1.0.2 | This module disable all inactive sessions since a given delay
[auth_signup_verify_email](auth_signup_verify_email/) | 10.0.1.0.0 | Force uninvited users to use a good email for signup
[auth_supplier](auth_supplier/) | 10.0.1.0.0 | Auth Supplier
Expand Down Expand Up @@ -70,7 +70,7 @@ addon | version | summary
[fetchmail_notify_error_to_sender](fetchmail_notify_error_to_sender/) | 10.0.1.0.0 | If fetching mails gives error, send an email to sender
[html_image_url_extractor](html_image_url_extractor/) | 10.0.1.0.0 | Extract images found in any HTML field
[html_text](html_text/) | 10.0.1.0.0 | Generate excerpts from any HTML field
[keychain](keychain/) | 10.0.2.0.0 | Store accounts and credentials
[keychain](keychain/) | 10.0.2.0.1 | Store accounts and credentials
[letsencrypt](letsencrypt/) | 10.0.1.0.0 | Request SSL certificates from letsencrypt.org
[mail_environment](mail_environment/) | 10.0.1.0.0 | Configure mail servers with server_environment_files
[mass_editing](mass_editing/) | 10.0.1.1.0 | Mass Editing
Expand Down
2 changes: 1 addition & 1 deletion password_security/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

'name': 'Password Security',
"summary": "Allow admin to set password security requirements.",
'version': '10.0.1.1.3',
'version': '10.0.1.1.4',
'author': "LasLabs, Odoo Community Association (OCA)",
'category': 'Base',
'depends': [
Expand Down
45 changes: 23 additions & 22 deletions password_security/tests/test_res_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,48 +4,49 @@

import time

from odoo.tests.common import TransactionCase
from odoo.tests.common import at_install, post_install, SavepointCase

from ..exceptions import PassError


class TestResUsers(TransactionCase):
@at_install(False)
@post_install(True)
class TestResUsers(SavepointCase):

def setUp(self):
super(TestResUsers, self).setUp()
self.main_comp = self.env.ref('base.main_company')
def setUp(cls):
super(TestResUsers, cls).setUp()
cls.main_comp = cls.env.ref('base.main_company')
# Modify users as privileged, but non-root user
privileged_user = self.env['res.users'].create({
cls.privileged_user = cls.env['res.users'].create({
'name': 'Privileged User',
'login': '[email protected]',
'company_id': self.main_comp.id,
'company_id': cls.main_comp.id,
'groups_id': [
(4, self.env.ref('base.group_erp_manager').id),
(4, self.env.ref('base.group_partner_manager').id),
(4, self.env.ref('base.group_user').id),
(4, cls.env.ref('base.group_erp_manager').id),
(4, cls.env.ref('base.group_partner_manager').id),
(4, cls.env.ref('base.group_user').id),
],
})
privileged_user.email = privileged_user.login
self.env = self.env(user=privileged_user)
self.login = '[email protected]'
self.partner_vals = {
cls.privileged_user.email = cls.privileged_user.login
cls.login = '[email protected]'
cls.partner_vals = {
'name': 'Partner',
'is_company': False,
'email': self.login,
'email': cls.login,
}
self.password = 'asdQWE123$%^'
self.vals = {
cls.password = 'asdQWE123$%^'
cls.vals = {
'name': 'User',
'login': self.login,
'password': self.password,
'company_id': self.main_comp.id
'login': cls.login,
'password': cls.password,
'company_id': cls.main_comp.id
}
self.model_obj = self.env['res.users']
cls.model_obj = cls.env['res.users']

def _new_record(self):
partner_id = self.env['res.partner'].create(self.partner_vals)
self.vals['partner_id'] = partner_id.id
return self.model_obj.create(self.vals)
return self.model_obj.create(self.vals).sudo(self.privileged_user)

def test_password_write_date_is_saved_on_create(self):
rec_id = self._new_record()
Expand Down

0 comments on commit 9efb951

Please sign in to comment.