Example #1
0
 def test_unparseable_salt(self):
     password = '******'
     with self.assertRaises(Exception) as e:
         hash_salt(password)
     self.assertEqual(
         "Could not parse salt out password correctly from $nTc1$Z28sUTcWfXlvVe2x.3XAa.",
         str(e.exception))
Example #2
0
    def test_retrieve_salt(self):
        password = '******'
        parsed = hash_salt(password)
        self.assertEqual(parsed, 'nTc1')

        password = '******'
        parsed = hash_salt(password)
        self.assertEqual(parsed, '14')