Skip to content

Instantly share code, notes, and snippets.

@samkit-jain
Last active September 15, 2021 12:45
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 samkit-jain/922c8e3317e521a534d8501309701675 to your computer and use it in GitHub Desktop.
Save samkit-jain/922c8e3317e521a534d8501309701675 to your computer and use it in GitHub Desktop.
def test_sign_up_01(client):
# Sign up a user by testing the ``POST /signup/`` API endpoint.
response = client.post(
"/signup/",
json={"username": "username", "password": "password"},
)
assert response.status_code == 200
assert response.json == {"message": "Registration successful"}
# If you want to go an extra step, can also check if the entry was created
# in the database or not. But, that is optional as you can verify the same
# in the signin API test.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment