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