title: How I can test form_valid method from CreateView class
body: <p>I have a Class view that inherits of CreateView</p>
  
  <pre><code>class CreateErrandView(ErrandFormMixin, CreateView):
      form_class = ErrandForm
  
      @method_decorator(ensure_csrf_cookie)
      def dispatch(self, *args, **kwargs):
          print("passes through here")
          return super(CreateErrandView, self).dispatch(*args, **kwargs)
  
      def form_valid(self, form, formset):
          print("create some transactions")
          print("not pass through here")
          return super(CreateErrandView, self).form_valid(form, formset)
  
      def post(self, *args, **kwargs):
          print("passes through here")
          return super(CreateErrandView, self).post(*args, **kwargs)
  </code></pre>
  
  <p>And I need write a test that make a post and execute form_valid method</p>
  
  <p>I wrote</p>
  
  <pre><code>class ErrandTransactionsTest(TestCase):
  
      def setUp(self):
          self.c = Client()
  
      def test__test_valid_form(self):
          # Arrange
          form_data = {
              u'type': 'taxi'
          }  
  
          form = ErrandForm(data=form_data)
  
          # Act
          self.assertEqual(form.is_valid(), True)
          response = self.c.post(reverse('errands_create'), form_data)
  
          # Assert
          self.assertEqual(len(Transactions.objects.all()), 5)
  </code></pre>
  
  <p>But it doesn't work.</p>
  
  <p>Thanks for any suggestions</p>