#27 added some testing infrastructure and tests for the authentication system added by issue #2 .
This issue is to add tests for the /user endpoint that will be used to save a new user account in the server & database.
To do this, I'd suggest modifying server/tests/test_authentication.py to
- Add a new test function, say
def test_new_user(client: FlaskClient), similar to the other functions in that file.
- Call
client.post in that new function with the right input data to make a request to create a new user.
- Ensure that the response status code is a success, e.g. 201
- Ensure that you can then log in as that new user by calling the
/login endpoint
To experiment with the /user endpoint, and others
- Start the Flask server as shown in CONTRIBUTING.md
- Open http://127.0.0.1:5000 in your browser and click the link there to get to the API test page
- Play with the APIs you're looking to test!
CONTRIBUTING.md also shows how to run tests in your terminal and VSCode
#27 added some testing infrastructure and tests for the authentication system added by issue #2 .
This issue is to add tests for the
/userendpoint that will be used to save a new user account in the server & database.To do this, I'd suggest modifying server/tests/test_authentication.py to
def test_new_user(client: FlaskClient), similar to the other functions in that file.client.postin that new function with the right input data to make a request to create a new user./loginendpointTo experiment with the
/userendpoint, and othersCONTRIBUTING.md also shows how to run tests in your terminal and VSCode