Ticket #17797: django-test-client-PATCH-tests.patch
File django-test-client-PATCH-tests.patch, 1.5 KB (added by , 13 years ago) |
---|
-
tests/regressiontests/test_client_regress/models.py
796 796 self.assertEqual(response.status_code, 200) 797 797 self.assertEqual(response.content, 'request method: DELETE') 798 798 799 def test_patch(self): 800 "Request a view via request method PATCH" 801 response = self.client.patch('/test_client_regress/request_methods/') 802 self.assertEqual(response.status_code, 200) 803 self.assertEqual(response.content, 'request method: PATCH') 804 805 799 806 class RequestMethodStringDataTests(TestCase): 800 807 def test_post(self): 801 808 "Request a view with string data via request method POST" … … 813 820 self.assertEqual(response.status_code, 200) 814 821 self.assertEqual(response.content, 'request method: PUT') 815 822 823 def test_patch(self): 824 "Request a view with string data via request method PATCH" 825 # Regression test for #11371 826 data = u'{"test": "json"}' 827 response = self.client.patch('/test_client_regress/request_methods/', data=data, content_type='application/json') 828 self.assertEqual(response.status_code, 200) 829 self.assertEqual(response.content, 'request method: PATCH') 830 831 816 832 class QueryStringTests(TestCase): 817 833 def test_get_like_requests(self): 818 834 # See: https://code.djangoproject.com/ticket/10571.