From 95e97113b3fe108a1dbf908ae6716b89e786c91d Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sun, 8 Sep 2013 22:34:08 -0400 Subject: - 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. --- CHANGES.txt | 4 ++++ pyramid/tests/test_traversal.py | 15 +++------------ 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 -- cgit v1.2.3