Chris Rossi
2010-11-22 c5f5572a5320ed0ddfc54ee4b03933b6280c9032
pyramid.testig.DummyRequest now has a class variable, query_string,
+ which defaults to the empty string.
2 files modified
26 ■■■■■ changed files
CHANGES.txt 3 ●●●●● patch | view | raw | blame | history
pyramid/testing.py 23 ●●●● patch | view | raw | blame | history
CHANGES.txt
@@ -10,6 +10,9 @@
  templates now use idiomatic SQLAlchemy configuration in their respective
  ``.ini`` files and Python code.
- ``pyramid.testig.DummyRequest`` now has a class variable, ``query_string``,
  which defaults to the empty string.
Bug Fixes
---------
pyramid/testing.py
@@ -41,7 +41,7 @@
    argument.  The authentication policy will return the userid
    identifier implied by the ``userid`` argument and the group ids
    implied by the ``groupids`` argument when the
    :func:`pyramid.security.authenticated_userid` or
    :func:`pyramid.security.authenticated_userid` or
    :func:`pyramid.security.effective_principals` APIs are used.
    This function is most useful when testing code that uses the APIs
@@ -211,7 +211,7 @@
    The ``name`` argument is the empty string by default; it implies
    the name under which the adapter is registered.
    See `The ZCA book <http://www.muthukadan.net/docs/zca.html>`_ for
    more information about ZCA adapters.
@@ -282,7 +282,7 @@
       registerSettings({'external_uri':'http://example.com'})
    Or a set of key/value pairs::
       registerSettings(external_uri='http://example.com')
    Use of this function is required when you need to test code that calls
@@ -361,7 +361,7 @@
    def implementation(self):
        return self._implementation
    def __call__(self, kw, system=None):
        if system:
            self._received.update(system)
@@ -393,7 +393,7 @@
                    raise AssertionError(
                        'A value for key "%s" was not passed to the renderer'
                        % k)
            if myval != v:
                raise AssertionError(
                    '\nasserted value for %s: %r\nactual value: %r' % (
@@ -431,7 +431,7 @@
        val.__name__ = name
        val.__parent__ = self
        self.subs[name] = val
    def __getitem__(self, name):
        """ Return a named subobject (see ``__setitem__``)"""
        ob = self.subs[name]
@@ -465,7 +465,7 @@
    def __contains__(self, name):
        return name in self.subs
    def clone(self, __name__=_marker, __parent__=_marker, **kw):
        """ Create a clone of the model object.  If ``__name__`` or
        ``__parent__`` arguments are passed, use these values to
@@ -485,7 +485,7 @@
class DummyRequest(object):
    """ A dummy request object (imitates a :term:`request` object).
    The ``params``, ``environ``, ``headers``, ``path``, and
    ``cookies`` arguments correspond to their :term`WebOb`
    equivalents.
@@ -503,6 +503,7 @@
    application_url = 'http://example.com'
    host = 'example.com:80'
    content_length = 0
    query_string = ''
    response_callbacks = ()
    def __init__(self, params=None, environ=None, headers=None, path='/',
                 cookies=None, post=None, **kw):
@@ -721,8 +722,8 @@
                    raise KeyError('No testing renderer registered for %r' %
                                   spec)
        return renderer
class MockTemplate(object):
    def __init__(self, response):
        self._received = {}
@@ -750,7 +751,7 @@
    return decorator
skip_on.os_name = os.name # for testing
try: # pragma: no cover
    import __pypy__
    import __pypy__
    skip_on.pypy = True
except ImportError:
    skip_on.pypy = False