From 0861ea7448c8c3b9951dfb89df9525fa4ba49c5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 22 Nov 2019 00:24:49 +0100 Subject: [PATCH] Use string when setting config option in tests Since issue8840, ConfigParser is used and enforces to set only string values. --- tests/test_authentication_sms.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/test_authentication_sms.py b/tests/test_authentication_sms.py index 3aedb8b829..ad317fec05 100644 --- a/tests/test_authentication_sms.py +++ b/tests/test_authentication_sms.py @@ -25,7 +25,7 @@ class AuthenticationSMSTestCase(ModuleTestCase): def setUp(self): super(AuthenticationSMSTestCase, self).setUp() - methods = config.get('session', 'authentications') + methods = config.get('session', 'authentications', default='') config.set('session', 'authentications', 'password_sms') self.addCleanup(config.set, 'session', 'authentications', methods) config.add_section('authentication_sms') @@ -35,12 +35,12 @@ class AuthenticationSMSTestCase(ModuleTestCase): self.addCleanup(config.remove_section, 'authentication_sms') del sms_queue[:] - length = config.get('password', 'length') - config.set('password', 'length', 4) + length = config.get('password', 'length', default='') + config.set('password', 'length', '4') self.addCleanup(config.set, 'password', 'length', length) - entropy = config.get('password', 'entropy') - config.set('password', 'entropy', 0.8) + entropy = config.get('password', 'entropy', default='') + config.set('password', 'entropy', '0.8') self.addCleanup(config.set, 'password', 'entropy', entropy) @with_transaction()