Skip to content

Instantly share code, notes, and snippets.

@PramodDutta
Created December 9, 2023 12:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PramodDutta/105628f9f05a6ec2279f9cfce4556568 to your computer and use it in GitHub Desktop.
Save PramodDutta/105628f9f05a6ec2279f9cfce4556568 to your computer and use it in GitHub Desktop.
test_create_token.py
import pytest
import requests
@pytest.mark.token
def test_post_create_token():
payload = {
"username": "admin",
"password": "password123"
}
headers = {
"Content-Type": "application/json",
}
response = requests.post("https://restful-booker.herokuapp.com/auth", headers=headers, json=payload)
print(response.status_code)
print(response.text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment