diff test/test_security.py @ 7184:8b2287d850c8

Fix round check/settings in needs_migration Support test rounds in needs_migration Two test were missing os.environ seting to have them use config setting.
author John Rouillard <rouilj@ieee.org>
date Sun, 26 Feb 2023 16:17:37 -0500
parents f6b24a8524cd
children cbeac604d9d5
line wrap: on
line diff
--- a/test/test_security.py	Sun Feb 26 15:38:49 2023 -0500
+++ b/test/test_security.py	Sun Feb 26 16:17:37 2023 -0500
@@ -423,14 +423,20 @@
         roundup.password.crypt = orig_crypt
 
     def test_pbkdf2_migrate_rounds(self):
-        self.db.config.PASSWORD_PBKDF2_DEFAULT_ROUNDS = 10000
+        '''Check that migration happens when number of rounds in
+           config is larger than number of rounds in current password.
+        '''
+
 
         p = roundup.password.Password('sekrit', 'PBKDF2',
                                       config=self.db.config)
 
         self.db.config.PASSWORD_PBKDF2_DEFAULT_ROUNDS = 2000000
 
+        os.environ["PYTEST_USE_CONFIG"] = "True"
         self.assertEqual(p.needs_migration(config=self.db.config), True)
+        del(os.environ["PYTEST_USE_CONFIG"])
+
 
     def test_encodePasswordNoConfig(self):
         # should run cleanly as we are in a test.

Roundup Issue Tracker: http://roundup-tracker.org/