          self.assertEqual(response.data, {'id': 4, 'text': 'foobar'})
          created = self.objects.get(id=4)
          self.assertEqual(created.text, 'foobar')
  
  
  EXPECTED_QUERIES_FOR_PUT = 3 if django.VERSION < (1, 6) else 2
  
  
  class TestInstanceView(TestCase):
 
</s> remove             raise ValidationError(self._errors)
 </s> add             raise ValidationError(self.errors) </s> remove         return [
 </s> add         ret = [
    def test_post_error_root_view(self):
        """
        POST requests to ListCreateAPIView in HTML should include a form error.
        """
        data = {'text': 'foobar' * 100}
        request = factory.post('/', data, HTTP_ACCEPT='text/html')
        response = self.view(request).render()
        expected_error = '<span class="help-block">Ensure this field has no more than 100 characters.</span>'
        self.assertIn(expected_error, response.rendered_content)

          self.assertEqual(response.data, {'id': 4, 'text': 'foobar'})
          created = self.objects.get(id=4)
          self.assertEqual(created.text, 'foobar')
  
    def test_post_error_root_view(self):
        """
        POST requests to ListCreateAPIView in HTML should include a form error.
        """
        data = {'text': 'foobar' * 100}
        request = factory.post('/', data, HTTP_ACCEPT='text/html')
        response = self.view(request).render()
        expected_error = '<span class="help-block">Ensure this field has no more than 100 characters.</span>'
        self.assertIn(expected_error, response.rendered_content)

  
  EXPECTED_QUERIES_FOR_PUT = 3 if django.VERSION < (1, 6) else 2
  
  
  class TestInstanceView(TestCase):
keep keep keep add keep keep keep keep keep
 Errors in browsable API on error. Closes #3024. 
tests/test_generics.py