Adding a parameter to the flask unittest Adding a parameter to the flask unittest flask flask

Adding a parameter to the flask unittest


I don't know your whole application however I see at least two things which could help you here:

  1. You shouldn't use self during creating the client because this is the object of the unittest.TestCase class, not the Flask application's one. And it will be passed automatically.
    tester = app.test_client() 
  2. Your endpoint use the URL parameter, so the get request should look more or less like this:
    tester.get(f"/add_application/{VACANCY_ID}", ...)
    *I have used here f-string, feel free to change it if you are not using >=3.6 version of Python