title: Django Test Client post() returns 302 despite error on view's post()
body: <p>I'm currently writing up some basic tests to ensure pages in a medium sized Django application are GETting and POSTing correctly.  However, using django.test.client.Client isn't reliably failing when it should be.  It returns a 302 response even when there's obviously placed errors in my code.</p>
  
  <p>in my app/urls.py:</p>
  
  <pre><code>url(r'^mymodel/create/$', 
  views.MyModelView.as_view(),
  name = 'my_model_create'),
  </code></pre>
  
  <p>Then, in attempts to intentionally create a 500 response, I did the following:</p>
  
  <pre><code>class MyModelCreateView(MyModelView, CreateView):
  
      def post(self, request, *args, **kwargs):
          print self.hello
          self.object = MyModel()
          return super(MyModelCreateView, self).post(request, *args, **kwargs)
  </code></pre>
  
  <p>Obviously, the view doesn't have any object called hello.  This fails as expected when trying to send the request through the browser.</p>
  
  <p>and even went as far as replacing "print self.hello" with </p>
  
  <pre><code>return HttpResponse(status = 500)
  </code></pre>
  
  <p>and yet, I still get the following:</p>
  
  <pre><code>#We have a model called Client, so it 
  #is imported as RequestClient to avoid conflicts
  In [1]: from django.test.client import Client as RequestClient
  
  In [2]: client = RequestClient()
  
  In [3]: response = client.post("/app/mymodel/create/")
  
  In [4]: response.status_code
  Out[4]: 302
  </code></pre>
  
  <p>Clearly the problem here is between the keyboard and the chair, since there's no reason Client()/RequestClient() shouldn't return a 500 error if done correctly.  Even some problems arise as I receive 302 responses for POST requests instead of 200 responses, but that may be because we're using HttpRedirect.</p>
  
  <p>Does anyone out there know what may be the problem here? For reference I'm on Python 2.7 and Django 1.5 (though I may need to be compatible with Django 1.4).</p>