From 043327890df5cd46498305a052de66785f20df49 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sun, 16 Nov 2008 01:28:10 +0000 Subject: Add r.bfg.convention support to pushpage decorator. --- CHANGES.txt | 3 +++ repoze/bfg/push.py | 1 + repoze/bfg/tests/test_push.py | 1 + 3 files changed, 5 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index acab4a605..80368d785 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,5 +1,8 @@ Next release + - Make pushpage decorator compatible with repoze.bfg.convention's + ``bfg_view`` decorator when they're stacked. + - Add content_length attribute to testing.DummyRequest. - Change paster template ``tests.py`` to include a true unit test. diff --git a/repoze/bfg/push.py b/repoze/bfg/push.py index 9b3197cf6..abc81adb5 100644 --- a/repoze/bfg/push.py +++ b/repoze/bfg/push.py @@ -28,5 +28,6 @@ class pushpage(object): kw = wrapped(context, request) return render_template_to_response(path, **kw) _curried.__name__ = wrapped.__name__ + _curried.__grok_module__ = wrapped.__module__ # r.bfg.convention support return _curried diff --git a/repoze/bfg/tests/test_push.py b/repoze/bfg/tests/test_push.py index 3dc456b58..e8d257c03 100644 --- a/repoze/bfg/tests/test_push.py +++ b/repoze/bfg/tests/test_push.py @@ -25,6 +25,7 @@ class Test_pushpage(unittest.TestCase, PlacelessSetup): pp = self._makeOne('pp.pt') wrapped = pp(to_wrap) self.assertEqual(wrapped.__name__, 'to_wrap') + self.assertEqual(wrapped.__grok_module__, to_wrap.__module__) def test___call___passes_names_from_wrapped(self): self._zcmlConfigure() -- cgit v1.2.3