Beispiel #1
0
    def test_default(self):
        hasher = 'hashers_passlib.phpass'

        with self.settings(SERVICE_PASSWORD_HASHER='default', PASSWORD_HASHERS=(hasher, )):
            load_service_hasher()
            hasher = get_service_hasher()
            self.assertEqual(hasher.algorithm, 'phpass')
Beispiel #2
0
    def test_default(self):
        hasher = 'hashers_passlib.phpass'

        with self.settings(SERVICE_PASSWORD_HASHER='default',
                           PASSWORD_HASHERS=(hasher, )):
            load_service_hasher()
            hasher = get_service_hasher()
            self.assertEqual(hasher.algorithm, 'phpass')
Beispiel #3
0
 def tearDown(self):
     load_service_hasher()
Beispiel #4
0
    def test_unknown(self):
        hasher = 'foobar.phpass'

        with self.settings(SERVICE_PASSWORD_HASHER=hasher, PASSWORD_HASHERS=(hasher, )), \
                self.assertRaises(ImproperlyConfigured):
            load_service_hasher()
Beispiel #5
0
 def test_wrong_hasher(self):
     with self.settings(SERVICE_PASSWORD_HASHER='foobar.blahugo'), \
             self.assertRaises(ImproperlyConfigured):
         load_service_hasher()
Beispiel #6
0
 def tearDown(self):
     load_service_hasher()