I have a login function with user and pass parameters that returns a token. I'am using flask. Now i need a test case to test my function, i am lost here. Neve done testing and i can't come up with the solution. I need a test case that verifies a token was created when the login is made. Any help?
def login():
user = request.form['user']
passwd = request.form['passwd']
test = ldap.bind_user(user, passwd)
if test is None or passwd == '':
response = jsonify(message='Invalid Credentials')
return response ,401
access_token = create_access_token(identity=user)
return jsonify(access_token=access_token), 200```