summaryrefslogtreecommitdiff
path: root/paste/fixture.py
diff options
context:
space:
mode:
authorianb <devnull@localhost>2006-06-21 00:03:01 +0000
committerianb <devnull@localhost>2006-06-21 00:03:01 +0000
commitca3c2f17768d1b609c7cafd05f317b6d24b833dc (patch)
tree1cc5c50645c08a54319b53d1f373ce1f5379bc9d /paste/fixture.py
parenta939f4810714fab3cc2d7ede2f95a3aace5477e1 (diff)
downloadpaste-ca3c2f17768d1b609c7cafd05f317b6d24b833dc.tar.gz
Put in a test to keep paste.testing_variables from clobbering an attribute of the response object
Diffstat (limited to 'paste/fixture.py')
-rw-r--r--paste/fixture.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/paste/fixture.py b/paste/fixture.py
index e35c24e..9fb6f34 100644
--- a/paste/fixture.py
+++ b/paste/fixture.py
@@ -317,6 +317,11 @@ class TestApp(object):
res = self._make_response(raw_res, end_time - start_time)
res.request = req
for name, value in req.environ['paste.testing_variables'].items():
+ if hasattr(res, name):
+ raise ValueError(
+ "paste.testing_variables contains the variable %r, but "
+ "the response object already has an attribute by that "
+ "name" % name)
setattr(res, name, value)
if self.namespace is not None:
self.namespace['res'] = res