title: How to perform a Django test with a request.post?
body: <p>I'm using Django 1.8 and Python 3.5.</p>
  <p>I have a view method I would love to test. I am supplying the <code>self.client.get</code> method with the data but it fails to validate the form. what am I doing wrong?</p>
  <p>This is the view method:</p>
  <pre><code>def saveNewDriverInfo(request):
      if  request.user.is_authenticated():
          form = DriverForm(request.POST)  
          if  form.is_valid():
              new_Driver = form.save()
              carid = form.cleaned_data['carID']
              Car = get_object_or_404(Car, pk=carid)
              return redirect('carmanager:carDetails', carID=carid
          else:
              return HttpResponse(&quot;something went wong some where! yes i said wong!&quot;)
  </code></pre>
  <p>This is the test method:</p>
  <pre><code> def test_saveNewDriverInfo(self):
              self.client.login(username=&quot;testuser&quot;,password=&quot;testuser321&quot;)
  response= self.client.get(reverse('carmanager:saveNewDriverInfo'),data={'form':{'carID':'1034567','Driver_Last_Name':'daddy','Driver_First_Name':'daddy','Driver_Middle_Initial':'K','entered_by':'king'}})
              #self.assertRedirects(response, expected_url, status_code, target_status_code, host, msg_prefix, fetch_redirect_response)
           
              self.assertNotContains(response, 'something went wrong' ,200)
  </code></pre>
  <p>Also, note that this test works because it gets the response. But the line that is commented out is what I want to use.</p>
  <p>However, I cant seem to feed the information to the DriverForm. Any help will be greatly appreciated.</p>