Chris McDonough
2011-08-17 8c900d2de7647f275b7bc140d8e401c38ca3260e
- Fix ``pyramid.config.preserve_view_attrs`` to not choke when the view it is
passed is ``None`` (FBO: pyramid_formish).
3 files modified
18 ■■■■■ changed files
CHANGES.txt 9 ●●●●● patch | view | raw | blame | history
pyramid/config.py 3 ●●●●● patch | view | raw | blame | history
pyramid/tests/test_config.py 6 ●●●●● patch | view | raw | blame | history
CHANGES.txt
@@ -1,3 +1,12 @@
Next release
============
Bug Fixes
---------
- Fix ``pyramid.config.preserve_view_attrs`` to not choke when the view it is
  passed is ``None`` (FBO: pyramid_formish).
1.1.1 (2011-08-13)
==================
pyramid/config.py
@@ -2890,6 +2890,9 @@
    if wrapper is view:
        return view
    if view is None:
        return wrapper
    original_view = getattr(view, '__original_view__', None)
    if original_view is None:
pyramid/tests/test_config.py
@@ -4689,6 +4689,12 @@
        result = self._callFUT(view, view)
        self.assertTrue(result is view)
    def test_view_is_None(self):
        def view(context, request):
            """ """
        result = self._callFUT(None, view)
        self.assertTrue(result is view)
    def test_it_different_with_existing_original_view(self):
        def view1(context, request): pass
        view1.__original_view__ = 'abc'