1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #20478 – Added support for HTTP PATCH method in generic views.

This commit is contained in:
Krzysztof Jurewicz
2013-05-21 18:01:29 +02:00
parent 0e51d8eb66
commit ee8b810b97
4 changed files with 14 additions and 2 deletions

View File

@@ -384,6 +384,12 @@ class RedirectViewTest(unittest.TestCase):
self.assertEqual(response.status_code, 301)
self.assertEqual(response.url, '/bar/')
def test_redirect_PATCH(self):
"Default is a permanent redirect"
response = RedirectView.as_view(url='/bar/')(self.rf.patch('/foo/'))
self.assertEqual(response.status_code, 301)
self.assertEqual(response.url, '/bar/')
def test_redirect_DELETE(self):
"Default is a permanent redirect"
response = RedirectView.as_view(url='/bar/')(self.rf.delete('/foo/'))