title: Django Test Client Method Override Header
body: <p>I am trying to test my update method on my viewset. The viewset is a modelviewset taken from drf. To update i would need to send a put request. As this is not always supported there are 2 ways to tell the server i am making a put request, the first which does not fit my needs is to use an additional field to form called <code>_method</code> and set it to <code>put</code>. As i need to post json data i need to use the second way, which uses the <code>X-HTTP-Method-Override</code> header.</p>
  
  <p>To post my data in the testcase i use the following code:</p>
  
  <pre><code>header = {'X_HTTP_METHOD_OVERRIDE': 'PUT'}
  response = client.post('/model/1/', content_type='application/json', data=post_data_clean, **header)
  </code></pre>
  
  <p>But unfortunately the result I get is <code>{'detail':'Method POST not allowed.'}</code>. I tested the behavior of the server using a addon (<a href="https://chrome.google.com/webstore/detail/postman/fhbjgbiflinjbdggehcddcbncdddomop" rel="noreferrer">Postman</a>) where i specified the <code>X-HTTP-Method-Override</code> header too. No exception is raised. I need to know now how to correctly pass the header to the django test client, otherwise testing will get really annoying over here.</p>