| 216 | |
| 217 | class AssertStoresPreviousRequestTests(TestCase): |
| 218 | host = 'subdomain.example.com' |
| 219 | def test_store_get(self): |
| 220 | response = self.client.get('/test_client/post_view/', {}, HTTP_HOST = self.host) |
| 221 | request = self.client.previous_request |
| 222 | self.assertEqual(request.method, 'GET') |
| 223 | self.assertEqual(request.META['HTTP_HOST'], self.host) |
| 224 | |
| 225 | def test_store_post(self): |
| 226 | response = self.client.post('/test_client/form_view_with_template/', {}, HTTP_HOST = self.host) |
| 227 | request = self.client.previous_request |
| 228 | self.assertEqual(request.method, 'POST') |
| 229 | self.assertEqual(request.META['HTTP_HOST'], self.host) |