title: How to set request args with Flask test_client?
body: <p>I have to test out a certain view that gets certain information from <code>request.args</code>.</p>
  <p>I can't mock this since a lot of stuff in the view uses the request object.
  The only alternative I can think of is to manually set <code>request.args</code>.</p>
  <p>I can do that with the <code>test_request_context()</code>, e.g:</p>
  <pre><code>with self.app.test_request_context() as req:
      req.request.args = {'code': 'mocked access token'}
      MyView()
  </code></pre>
  <p>Now the request inside this view will have the arguments that I've set.
  However I need to call my view, not just initialize it, so I use this:</p>
  <pre><code>with self.app.test_client() as c:
      resp = c.get('/myview')
  </code></pre>
  <p>But I don't know how to manipulate the request arguments in this manner.</p>
  <p>I have tried this:</p>
  <pre><code>with self.app.test_client() as c:
      with self.app.test_request_context() as req:
          req.request.args = {'code': 'mocked access token'}
          resp = c.get('/myview')
  </code></pre>
  <p>but this does not set <code>request.args</code>.</p>