Testing GET request using Flask Test Client

Report a typo

In this problem, you will see how to write a test and use the Flask test client for sending GET requests. Write the function test_app_using_test_client which accepts three parameters app, url and expected

  • app is a Flask app
  • url is a URL exposed via the app
  • expected is the expected JSON response on sending a GET request to the URL.

Assert that the response's JSON is same as the expected variable.

Write a program in Python 3
def test_app_using_test_client(flask_app, url, expected):
pass
___

Create a free account to access the full topic