How to set request args with Flask test_client?

Pass the query_string argument to c.get, which can either be a dict, a MultiDict, or an already encoded string.

with app.test_client() as c:
    r = c.get("https://stackoverflow.com/", query_string={'name': 'davidism'})

The test client request methods pass their arguments to Werkzeug’s EnvironBuilder, which is where this is documented.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)