diff options
| author | Chris McDonough <chrism@plope.com> | 2013-09-08 22:34:08 -0400 |
|---|---|---|
| committer | Chris McDonough <chrism@plope.com> | 2013-09-08 22:34:08 -0400 |
| commit | 95e97113b3fe108a1dbf908ae6716b89e786c91d (patch) | |
| tree | 15c7ba5c288ee2606516226141501e198e85e644 | |
| parent | 6d14fa5f0aa469ecd096d92a787281d3d87776cf (diff) | |
| download | pyramid-95e97113b3fe108a1dbf908ae6716b89e786c91d.tar.gz pyramid-95e97113b3fe108a1dbf908ae6716b89e786c91d.tar.bz2 pyramid-95e97113b3fe108a1dbf908ae6716b89e786c91d.zip | |
- Removed ancient backwards compatibily hack in
``pyramid.traversal.DefaultRootFactory`` which populated the ``__dict__`` of
the factory with the matchdict values for compatibility with BFG 0.9.
| -rw-r--r-- | CHANGES.txt | 4 | ||||
| -rw-r--r-- | pyramid/tests/test_traversal.py | 15 | ||||
| -rw-r--r-- | pyramid/traversal.py | 7 |
3 files changed, 8 insertions, 18 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index 641219a8b..6abef1e6b 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -98,6 +98,10 @@ Backwards Incompatibilities since Pyramid 1.1. Use methods of ``request.environ`` (a real dictionary) instead. +- Removed ancient backwards compatibily hack in + ``pyramid.traversal.DefaultRootFactory`` which populated the ``__dict__`` of + the factory with the matchdict values for compatibility with BFG 0.9. + 1.5a1 (2013-08-30) ================== diff --git a/pyramid/tests/test_traversal.py b/pyramid/tests/test_traversal.py index ff5937811..0dcc4a027 100644 --- a/pyramid/tests/test_traversal.py +++ b/pyramid/tests/test_traversal.py @@ -1278,22 +1278,13 @@ class TestDefaultRootFactory(unittest.TestCase): def _makeOne(self, environ): return self._getTargetClass()(environ) - def test_no_matchdict(self): - class DummyRequest: - matchdict = None + def test_it(self): + class DummyRequest(object): + pass root = self._makeOne(DummyRequest()) self.assertEqual(root.__parent__, None) self.assertEqual(root.__name__, None) - def test_matchdict(self): - class DummyRequest: - pass - request = DummyRequest() - request.matchdict = {'a':1, 'b':2} - root = self._makeOne(request) - self.assertEqual(root.a, 1) - self.assertEqual(root.b, 2) - class Test__join_path_tuple(unittest.TestCase): def _callFUT(self, tup): from pyramid.traversal import _join_path_tuple diff --git a/pyramid/traversal.py b/pyramid/traversal.py index 341ed2d75..4c275c4c1 100644 --- a/pyramid/traversal.py +++ b/pyramid/traversal.py @@ -822,9 +822,4 @@ class DefaultRootFactory: __parent__ = None __name__ = None def __init__(self, request): - matchdict = request.matchdict - # provide backwards compatibility for applications which - # used routes (at least apps without any custom "context - # factory") in BFG 0.9.X and before - if matchdict is not None: - self.__dict__.update(matchdict) + pass |
