Ticket #17768: expected_failure.diff

File expected_failure.diff, 946 bytes (added by Claude Paroz, 13 years ago)

Adding comment about expected failure

  • tests/regressiontests/generic_views/edit.py

    diff --git a/tests/regressiontests/generic_views/edit.py b/tests/regressiontests/generic_views/edit.py
    index 182615a..2bd982e 100644
    a b class UpdateViewTests(TestCase):  
    126126
    127127        res = self.client.put('/edit/author/%d/update/' % a.pk,
    128128                        {'name': 'Randall Munroe (author of xkcd)', 'slug': 'randall-munroe'})
     129        # Here is the expected failure. PUT data are not processed in any special
     130        # way by django. So the request will equal to a POST without data, hence
     131        # the form will be invalid and redisplayed with errors (status code 200).
     132        # See also #12635
    129133        self.assertEqual(res.status_code, 302)
    130134        self.assertRedirects(res, 'http://testserver/list/authors/')
    131135        self.assertQuerysetEqual(Author.objects.all(), ['<Author: Randall Munroe (author of xkcd)>'])
Back to Top