Mercurial > p > roundup > code
diff test/test_cgi.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 | 1549c7e74ef8 |
| children | 978285986b2c |
line wrap: on
line diff
--- a/test/test_cgi.py Sun Feb 26 15:38:49 2023 -0500 +++ b/test/test_cgi.py Sun Feb 26 16:17:37 2023 -0500 @@ -593,6 +593,8 @@ # below will be 100000 cl.db.Otk = self.db.Otk pw1 = pw + # do not use the production number of PBKDF2 + os.environ["PYTEST_USE_CONFIG"] = "True" cl.db.config.PASSWORD_PBKDF2_DEFAULT_ROUNDS = 100000 self.assertEqual(pw1.needs_migration(config=cl.db.config), True) scheme = password.Password.known_schemes[0] @@ -600,6 +602,7 @@ actions.LoginAction(cl).handle() pw = cl.db.user.get(chef, 'password') self.assertEqual(pw, 'foo') + del(os.environ["PYTEST_USE_CONFIG"]) # do not assert self.assertEqual(pw, pw1) as pw is a 100,000 # cycle while pw1 is only 10,000. They won't compare equally.
