summaryrefslogtreecommitdiff
path: root/pyramid/tests/test_config.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyramid/tests/test_config.py')
-rw-r--r--pyramid/tests/test_config.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/pyramid/tests/test_config.py b/pyramid/tests/test_config.py
index c129b21ae..a0bdf95ad 100644
--- a/pyramid/tests/test_config.py
+++ b/pyramid/tests/test_config.py
@@ -739,6 +739,19 @@ class ConfiguratorTests(unittest.TestCase):
result = wrapper(None, None)
self.assertEqual(result, 'OK')
+ def test_add_view_with_decorator(self):
+ def view(request):
+ return 'OK'
+ def view_wrapper(fn):
+ fn.__assert_wrapped__ = True
+ return fn
+ config = self._makeOne(autocommit=True)
+ config.add_view(view=view, decorator=view_wrapper)
+ wrapper = self._getViewCallable(config)
+ self.assertTrue(getattr(wrapper, '__assert_wrapped__', False))
+ result = wrapper(None, None)
+ self.assertEqual(result, 'OK')
+
def test_add_view_as_instance(self):
class AView:
def __call__(self, context, request):