def test_user_auth_token(self): username = uuid.uuid4().hex password = uuid.uuid4().hex user = User.create(username, password) self.assertEqual( user.get_auth_token(), login_serializer.dumps([str(user.id), user.password]))
def get_auth_token(self): return login_serializer.dumps([str(self.id), self.password])