Ticket #4955: test_client_regress_models_py.patch

File test_client_regress_models_py.patch, 1007 bytes (added by snhorne@…, 17 years ago)

tests.regressiontests.test_client_regress.models

  • models.py

     
    213213        }
    214214        response = self.client.post('/test_client_regress/file_upload/', post_data)
    215215        self.assertEqual(response.status_code, 200)
     216       
     217class 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)
Back to Top