forked from odoo/odoo
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IMP] Use helper function instead of hardcoded test passwords.
It is necessary to remove hardcoded passwords as modules like auth_password_policy (and external modules like OCA server-auth/password_security) add additional complexity requirements that hardcoded passwords may not meet.
- Loading branch information
Showing
14 changed files
with
77 additions
and
41 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,7 +43,6 @@ def setUpClass(cls, chart_template_ref=None): | |
user = cls.env['res.users'].create({ | ||
'name': 'Because I am accountman!', | ||
'login': 'accountman', | ||
'password': 'accountman', | ||
'groups_id': [(6, 0, cls.env.user.groups_id.ids), (4, cls.env.ref('account.group_account_user').id)], | ||
}) | ||
user.partner_id.email = '[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
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import test_password |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Part of Odoo. See LICENSE file for full copyright and licensing details. | ||
|
||
from odoo.tests import new_test_pass, TransactionCase | ||
|
||
|
||
class TestPassword(TransactionCase): | ||
def test_new_test_pass(self): | ||
password1 = new_test_pass(self.env, 'testpass') | ||
password2 = new_test_pass(self.env, 'testpass') | ||
self.assertEqual(password1, password2) | ||
|
||
User = self.env['res.users'] | ||
User._check_password_policy([password1]) |
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 |
---|---|---|
|
@@ -10,7 +10,7 @@ class TestCalendarController(HttpCase): | |
def setUp(self): | ||
super().setUp() | ||
self.user = new_test_user(self.env, "test_user_1", email="[email protected]", tz="UTC") | ||
self.other_user = new_test_user(self.env, "test_user_2", email="[email protected]", password="P@ssw0rd!", tz="UTC") | ||
self.other_user = new_test_user(self.env, "test_user_2", email="[email protected]", tz="UTC") | ||
self.partner = self.user.partner_id | ||
self.event = ( | ||
self.env["calendar.event"] | ||
|
@@ -41,7 +41,7 @@ def test_accept_meeting_authenticated(self): | |
attendee = self.event.attendee_ids.filtered(lambda att: att.partner_id.id == self.other_user.partner_id.id) | ||
token = attendee.access_token | ||
url = "/calendar/meeting/accept?token=%s&id=%d" % (token, self.event.id) | ||
self.authenticate("test_user_2", "P@ssw0rd!") | ||
self.authenticate("test_user_2") | ||
res = self.url_open(url) | ||
|
||
self.assertEqual(res.status_code, 200, "Response should = OK") | ||
|
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
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
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