From 3809b017e335ff8787d62baa005bb9fe58547f3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 29 Apr 2017 21:43:08 +0200 Subject: [PATCH] Update configuration in tests for new constraint on user password --- tests/test_authentication_sms.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tests/test_authentication_sms.py b/tests/test_authentication_sms.py index 5270762c18..3aedb8b829 100644 --- a/tests/test_authentication_sms.py +++ b/tests/test_authentication_sms.py @@ -35,6 +35,14 @@ class AuthenticationSMSTestCase(ModuleTestCase): self.addCleanup(config.remove_section, 'authentication_sms') del sms_queue[:] + length = config.get('password', 'length') + config.set('password', 'length', 4) + self.addCleanup(config.set, 'password', 'length', length) + + entropy = config.get('password', 'entropy') + config.set('password', 'entropy', 0.8) + self.addCleanup(config.set, 'password', 'entropy', entropy) + @with_transaction() def test_sms_code_default_code(self): pool = Pool() @@ -98,7 +106,7 @@ class AuthenticationSMSTestCase(ModuleTestCase): SMSCode = pool.get('res.user.login.sms_code') user = User( - name='sms', login='sms', password='sms', mobile='+123456789') + name='sms', login='sms', password='secret', mobile='+123456789') user.save() with self.assertRaises(LoginException) as cm: @@ -108,7 +116,7 @@ class AuthenticationSMSTestCase(ModuleTestCase): with self.assertRaises(LoginException) as cm: User.get_login('sms', { - 'password': 'sms', + 'password': 'secret', }) self.assertEqual(cm.exception.name, 'sms_code') self.assertEqual(cm.exception.type, 'char') @@ -117,7 +125,7 @@ class AuthenticationSMSTestCase(ModuleTestCase): sms_code = record.code user_id = User.get_login('sms', { - 'password': 'sms', + 'password': 'secret', 'sms_code': sms_code, }) self.assertEqual(user_id, user.id)