8000 Refs #23943 -- Removed an invalid generic_views test. · alex-python/django@df9f2e4 · GitHub
[go: up one dir, main page]

Skip to content

Commit df9f2e4

Browse files
committed
Refs #23943 -- Removed an invalid generic_views test.
Using PUT as a method for the form element is no longer supported as described in the ticket.
1 parent c72eb80 commit df9f2e4

File tree

1 file changed

+0
-21
lines changed

1 file changed

+0
-21
lines changed

tests/generic_views/test_edit.py

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from __future__ import unicode_literals
22

3-
from unittest import expectedFailure
43
import warnings
54

65
from django.core.exceptions import ImproperlyConfigured
@@ -242,26 +241,6 @@ def test_update_post(self):
242241
self.assertRedirects(res, 'http://testserver/list/authors/')
243242
self.assertQuerysetEqual(Author.objects.all(), ['<Author: Randall Munroe (xkcd)>'])
244243

245-
@expectedFailure
246-
def test_update_put(self):
247-
a = Author.objects.create(
248-
name='Randall Munroe',
249-
slug='randall-munroe',
250-
)
251-
res = self.client.get('/edit/author/%d/update/' % a.pk)
252-
self.assertEqual(res.status_code, 200)
253-
self.assertTemplateUsed(res, 'generic_views/author_form.html')
254-
255-
res = self.client.put('/edit/author/%d/update/' % a.pk,
256-
{'name': 'Randall Munroe (author of xkcd)', 'slug': 'randall-munroe'})
257-
# Here is the expected failure. PUT data are not processed in any special
258-
# way by django. So the request will equal to a POST without data, hence
259-
# the form will be invalid and redisplayed with errors (status code 200).
260-
# See also #12635
261-
self.assertEqual(res.status_code, 302)
262-
self.assertRedirects(res, 'http://testserver/list/authors/')
263-
self.assertQuerysetEqual(Author.objects.all(), ['<Author: Randall Munroe (author of xkcd)>'])
264-
265244
def test_update_invalid(self):
266245
a = Author.objects.create(
267246
name='Randall Munroe',

0 commit comments

Comments
 (0)
0