Пример #1
0
	def password(self, plain_password):

		self._salt, self._password = Utils.hash_password(plain_password) 
Пример #2
0
	def test_check_valid_hash_and_plain_password(self):
		s_salt, s_password = Utils.hash_password(self.password)
		isCheck = Utils.verify_password(s_salt, s_password, self.password)
		self.assertTrue(isCheck)
Пример #3
0
	def test_check_hash_and_invalid_plain_password(self):
		invalid_password = "******"
		s_salt, s_password = Utils.hash_password(self.password)
		isCheck = Utils.verify_password(s_salt, s_password, invalid_password)
		self.assertFalse(isCheck)
Пример #4
0
	def test_hash_password_is_not_none(self):
		
		salt, password = Utils.hash_password(self.password)
		self.assertIsNotNone(salt)
		self.assertIsNotNone(password)