Created
July 25, 2022 12:19
-
-
Save dubeyji10/c076eda70e0043281454b699f2de5bde to your computer and use it in GitHub Desktop.
Test Case #2 Invalid Credentials registration of new user
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
# https://www.ontestautomation.com/writing-tests-for-restful-apis-in-python-using-requests-part-1-basic-tests/ | |
print('trying to create a user with invalid password -- length < 5') | |
userDict = { | |
'username':'dubeyji1', | |
'password':'five', | |
'role':'admin' | |
} | |
print('user :',userDict) | |
print('making request') | |
#response = requests.post(url="http://localhost:8080/auth/post-test",data = userDict) | |
response = requests.post(url="http://localhost:8080/auth/register",data = userDict) | |
print("response : ",response.text) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment