| 803 | def test_get(self): |
| 804 | "Request a view with string data via request method get" |
| 805 | # Regression test for #18048 |
| 806 | data = u'{"test": "json"}' |
| 807 | response = self.client.get('/test_client_regress/request_methods/', data=data, content_type='application/json') |
| 808 | self.assertEqual(response.status_code, 200) |
| 809 | self.assertEqual(response.content, 'request method: GET') |
| 810 | |
| 811 | def test_head(self): |
| 812 | "Request a view with string data via request method head" |
| 813 | # Regression test for #18048 |
| 814 | data = u'{"test": "json"}' |
| 815 | response = self.client.head('/test_client_regress/request_methods/', data=data, content_type='application/json') |
| 816 | self.assertEqual(response.status_code, 200) |
| 817 | self.assertEqual(response.content, 'request method: HEAD') |
| 818 | |
| 819 | def test_options(self): |
| 820 | "Request a view with string data via request method options" |
| 821 | # Regression test for #18048 |
| 822 | data = u'{"test": "json"}' |
| 823 | response = self.client.options('/test_client_regress/request_methods/', data=data, content_type='application/json') |
| 824 | self.assertEqual(response.status_code, 200) |
| 825 | self.assertEqual(response.content, 'request method: OPTIONS') |
| 826 | |
| 827 | def test_delete(self): |
| 828 | "Request a view with string data via request method DELETE" |
| 829 | # Regression test for #18048 |
| 830 | data = u'{"test": "json"}' |
| 831 | response = self.client.delete('/test_client_regress/request_methods/', data=data, content_type='application/json') |
| 832 | self.assertEqual(response.status_code, 200) |
| 833 | self.assertEqual(response.content, 'request method: DELETE') |
| 834 | |