def test_password_is_encrypted(self): import phpass phpass.PasswordHash.hash_password = self.hash_password_original payload = UserPayload().blend() response = payload.post() user = safe_query(self, User, 'id', response.id, 'id') self.assertNotEqual(user.password, payload['data']['attributes']['password']) self.assertEqual(user.password[:7], "$2a$11$")
def test_backend_generate_secid(self): payload = UserPayload().blend() response = payload.post() user = safe_query(self, User, 'id', response.id, 'id') self.assertNotEqual(unicode(payload['data']['attributes']['secid']), user.secid)