Mercurial > p > roundup > code
comparison test/test_security.py @ 6626:120b0bb05b6e
issue2551191 - Module deprication PEP 594. crypt
Handle missing crypt module "better" by raising an exception rather
than just silently failing to log in the user when a crypt encoded
password can't be checked.
Update tests and upgrading.txt too.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Sun, 20 Mar 2022 00:05:59 -0400 |
| parents | bdcccd2b2141 |
| children | cfdcaf8b5936 |
comparison
equal
deleted
inserted
replaced
| 6625:a67692d50ede | 6626:120b0bb05b6e |
|---|---|
| 409 self.assertEqual(has(uimu, 'issue', 'messages.author'), 1) | 409 self.assertEqual(has(uimu, 'issue', 'messages.author'), 1) |
| 410 self.assertEqual(has(uimu, 'issue', 'messages.author.username'), 1) | 410 self.assertEqual(has(uimu, 'issue', 'messages.author.username'), 1) |
| 411 self.assertEqual(has(uimu, 'issue', 'messages.recipients'), 1) | 411 self.assertEqual(has(uimu, 'issue', 'messages.recipients'), 1) |
| 412 self.assertEqual(has(uimu, 'issue', 'messages.recipients.username'), 1) | 412 self.assertEqual(has(uimu, 'issue', 'messages.recipients.username'), 1) |
| 413 | 413 |
| 414 # roundup.password has its own built-in test, call it. | 414 # roundup.password has its own built-in tests, call them. |
| 415 def test_password(self): | 415 def test_password(self): |
| 416 roundup.password.test() | 416 roundup.password.test() |
| 417 | 417 |
| 418 # pretend import of crypt failed | |
| 419 orig_crypt = roundup.password.crypt | |
| 420 roundup.password.crypt = None | |
| 421 with self.assertRaises(roundup.password.PasswordValueError) as ctx: | |
| 422 roundup.password.test_missing_crypt() | |
| 423 roundup.password.crypt = orig_crypt | |
| 424 | |
| 418 # vim: set filetype=python sts=4 sw=4 et si : | 425 # vim: set filetype=python sts=4 sw=4 et si : |
