title: Testing in Django Rest Framework, reproduce this curl request?
body: <p>I am trying to run some testing for <a href="http://www.django-rest-framework.org/api-guide/testing" rel="nofollow">Django Rest Framework</a> (links to testing) and reproduce this curl call:</p>
  
  <pre><code>curl -X POST -d "grant_type=password&amp;username=&lt;user_name&gt;&amp;password=&lt;password&gt;"
  http://&lt;client_id&gt;:&lt;client_secret&gt;@127.0.0.1:8000/v1/token/
  </code></pre>
  
  <p>This is what I have tried:</p>
  
  <pre><code>  def test_oauth2_token_for_user(self):
          """
          Test Django OAuth Toolkit and make a request for am access token.
          """
          self.client.credentials(HTTP_AUTHORIZATION='grant_type ' + "password&amp;username=&lt;user_name&gt;&amp;password=&lt;password")
          response = self.client.post('/api/token/')
  </code></pre>
  
  <p>Could someone tell me where to start. I am unsure how to send the header <code>grant_type=password&amp;username=&lt;user_name&gt;&amp;password=&lt;password&gt;</code> and format the URL with the username and password.</p>