Code

Ticket #17768: expected_failure.diff

File expected_failure.diff, 946 bytes (added by claudep, 2 years ago)

Adding comment about expected failure

Line 
1diff --git a/tests/regressiontests/generic_views/edit.py b/tests/regressiontests/generic_views/edit.py
2index 182615a..2bd982e 100644
3--- a/tests/regressiontests/generic_views/edit.py
4+++ b/tests/regressiontests/generic_views/edit.py
5@@ -126,6 +126,10 @@ class UpdateViewTests(TestCase):
6 
7         res = self.client.put('/edit/author/%d/update/' % a.pk,
8                         {'name': 'Randall Munroe (author of xkcd)', 'slug': 'randall-munroe'})
9+        # Here is the expected failure. PUT data are not processed in any special
10+        # way by django. So the request will equal to a POST without data, hence
11+        # the form will be invalid and redisplayed with errors (status code 200).
12+        # See also #12635
13         self.assertEqual(res.status_code, 302)
14         self.assertRedirects(res, 'http://testserver/list/authors/')
15         self.assertQuerysetEqual(Author.objects.all(), ['<Author: Randall Munroe (author of xkcd)>'])