Permalink
Browse files

- 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.
  • Loading branch information...
1 parent 6d14fa5 commit 95e97113b3fe108a1dbf908ae6716b89e786c91d @mcdonc mcdonc committed Sep 9, 2013
Showing with 8 additions and 18 deletions.
  1. +4 −0 CHANGES.txt
  2. +3 −12 pyramid/tests/test_traversal.py
  3. +1 −6 pyramid/traversal.py
View
@@ -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)
==================
@@ -1278,22 +1278,13 @@ def _getTargetClass(self):
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
View
@@ -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

0 comments on commit 95e9711

Please sign in to comment.