| 577 | class RequestMethodStringDataTests(TestCase): |
| 578 | def test_post(self): |
| 579 | "Request a view with string data via request method POST" |
| 580 | # Regression test for #11371 |
| 581 | data = u'{"test": "json"}' |
| 582 | response = self.client.post('/test_client_regress/request_methods/', data=data, content_type='application/json') |
| 583 | self.assertEqual(response.status_code, 200) |
| 584 | self.assertEqual(response.content, 'request method: POST') |
| 585 | |
| 586 | def test_put(self): |
| 587 | "Request a view with string data via request method PUT" |
| 588 | # Regression test for #11371 |
| 589 | data = u'{"test": "json"}' |
| 590 | response = self.client.put('/test_client_regress/request_methods/', data=data, content_type='application/json') |
| 591 | self.assertEqual(response.status_code, 200) |
| 592 | self.assertEqual(response.content, 'request method: PUT') |
| 593 | |