summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pecan/core.py3
-rw-r--r--pecan/tests/test_base.py19
2 files changed, 18 insertions, 4 deletions
diff --git a/pecan/core.py b/pecan/core.py
index e4fdd99..e1662ac 100644
--- a/pecan/core.py
+++ b/pecan/core.py
@@ -500,9 +500,6 @@ class Pecan(object):
request.pecan['content_type'] = 'application/json'
result = self.render(template, result)
- if 'pecan.params' in request.environ:
- params = request.environ.pop('pecan.params')
-
# If we are in a test request put the namespace where it can be
# accessed directly
if request.environ.get('paste.testing'):
diff --git a/pecan/tests/test_base.py b/pecan/tests/test_base.py
index 24ee248..d4b4371 100644
--- a/pecan/tests/test_base.py
+++ b/pecan/tests/test_base.py
@@ -848,7 +848,24 @@ class TestStreamedResponse(PecanTestCase):
assert r.body == 'plain text'
-class TestStateCleanup(PecanTestCase):
+class TestThreadLocalState(PecanTestCase):
+
+ def test_thread_local_dir(self):
+ """
+ Threadlocal proxies for request and response should properly
+ proxy ``dir()`` calls to the underlying webob class.
+ """
+ class RootController(object):
+ @expose()
+ def index(self):
+ assert 'method' in dir(request)
+ assert 'status' in dir(response)
+ return '/'
+
+ app = TestApp(Pecan(RootController()))
+ r = app.get('/')
+ assert r.status_int == 200
+ assert r.body == '/'
def test_request_state_cleanup(self):
"""