Chris McDonough
2013-07-16 b54f6d7bac10f7970d5443c435a125867c13a652
backport master fix from Pylons/pyramid#1032 to 1.4-branch
3 files modified
15 ■■■■■ changed files
CHANGES.txt 8 ●●●●● patch | view | raw | blame | history
pyramid/testing.py 3 ●●●●● patch | view | raw | blame | history
pyramid/tests/test_testing.py 4 ●●●● patch | view | raw | blame | history
CHANGES.txt
@@ -1,3 +1,11 @@
Next 1.4 release
================
- ``pyramid.testing.DummyResource`` didn't define ``__bool__``, so code under
   Python 3 would use ``__len__`` to find truthiness; this usually caused an
   instance of DummyResource to be "falsy" instead of "truthy".  See
   https://github.com/Pylons/pyramid/pull/1032
1.4.2 (2013-05-21)
==================
pyramid/testing.py
@@ -219,6 +219,9 @@
    __iter__ = keys
    def __bool__(self):
        return True
    def __nonzero__(self):
        return True
pyramid/tests/test_testing.py
@@ -114,6 +114,10 @@
        resource = self._makeOne()
        self.assertEqual(resource.__nonzero__(), True)
    def test_bool(self):
        resource = self._makeOne()
        self.assertEqual(resource.__bool__(), True)
    def test_ctor_with__provides__(self):
        resource = self._makeOne(__provides__=IDummy)
        self.assertTrue(IDummy.providedBy(resource))