From 6013dd83bb96bc1f654fb8a0d7e7b29c25bfa36a Mon Sep 17 00:00:00 2001 From: Brian Waldon Date: Wed, 8 Feb 2012 13:22:51 -0800 Subject: Add content-type to responses * fixes bug 928055 Change-Id: Id86a9b3361d27493ed5ef175462aa1d4c1001bf4 --- tests/test_wsgi.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 tests/test_wsgi.py (limited to 'tests') diff --git a/tests/test_wsgi.py b/tests/test_wsgi.py new file mode 100644 index 00000000..cf329ba7 --- /dev/null +++ b/tests/test_wsgi.py @@ -0,0 +1,25 @@ +import webob + +from keystone import test +from keystone.common import wsgi + + +class FakeApp(wsgi.Application): + def index(self, context): + return {'a': 'b'} + + +class ApplicationTest(test.TestCase): + def setUp(self): + self.app = FakeApp() + + def _make_request(self): + req = webob.Request.blank('/') + args = {'action': 'index', 'controller': self.app} + req.environ['wsgiorg.routing_args'] = [None, args] + return req + + def test_response_content_type(self): + req = self._make_request() + resp = req.get_response(self.app) + self.assertEqual(resp.content_type, 'application/json') -- cgit