Paul's Programming Notes     Archive     Feed     Github

Request.Args Empty During Tests - Flask

https://github.com/mitsuhiko/flask/issues/801#issuecomment-21513278

If you're using app.test_client().get, it's very important to use a relative url or your parameters will be removed.

# will not pass request.args
rv = self.client.get('http://0.0.0.0:5000/view/?foo=bar')

# works just fine
rv = self.client.get('/view/?foo=bar')