From ca3c2f17768d1b609c7cafd05f317b6d24b833dc Mon Sep 17 00:00:00 2001 From: ianb Date: Wed, 21 Jun 2006 00:03:01 +0000 Subject: Put in a test to keep paste.testing_variables from clobbering an attribute of the response object --- paste/fixture.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'paste/fixture.py') 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 -- cgit v1.2.1