From 776f6902d900a146d78279d10959caacdbe0c0e9 Mon Sep 17 00:00:00 2001 From: Mads Jensen Date: Thu, 28 Sep 2017 21:52:11 +0200 Subject: [PATCH] Moved BasePasswordHasher tests to its own test case. --- tests/auth_tests/test_hashers.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/auth_tests/test_hashers.py b/tests/auth_tests/test_hashers.py index cf12fd41681..f00e2720b9d 100644 --- a/tests/auth_tests/test_hashers.py +++ b/tests/auth_tests/test_hashers.py @@ -429,10 +429,15 @@ class TestUtilsHashPass(SimpleTestCase): check_password('wrong_password', encoded) self.assertEqual(hasher.harden_runtime.call_count, 1) + +class BasePasswordHasherTests(SimpleTestCase): + def setUp(self): + self.hasher = BasePasswordHasher() + def test_load_library_no_algorithm(self): msg = "Hasher 'BasePasswordHasher' doesn't specify a library attribute" with self.assertRaisesMessage(ValueError, msg): - BasePasswordHasher()._load_library() + self.hasher._load_library() def test_load_library_importerror(self): PlainHasher = type('PlainHasher', (BasePasswordHasher,), {'algorithm': 'plain', 'library': 'plain'})