Skip to content

Commit

Permalink
Merge branch 'wylee-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
mcdonc committed Nov 3, 2012
2 parents 44d73a4 + c60c0e0 commit 487cb60
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
6 changes: 1 addition & 5 deletions pyramid/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
from pyramid.request import Request
from pyramid.response import Response
Response.RequestClass = Request
Request.ResponseClass = Response
del Request, Response
# package
2 changes: 2 additions & 0 deletions pyramid/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,8 @@ class Request(BaseRequest, DeprecatedRequestMethodsMixin, URLMethodsMixin,
matchdict = None
matched_route = None

ResponseClass = Response

@reify
def tmpl_context(self):
# docs-deprecated template context for Pylons-like apps; do not
Expand Down
6 changes: 5 additions & 1 deletion pyramid/tests/test_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,17 @@ def test_class_conforms_to_IRequest(self):
from zope.interface.verify import verifyClass
from pyramid.interfaces import IRequest
verifyClass(IRequest, self._getTargetClass())
klass = self._getTargetClass()

def test_instance_conforms_to_IRequest(self):
from zope.interface.verify import verifyObject
from pyramid.interfaces import IRequest
verifyObject(IRequest, self._makeOne())

def test_ResponseClass_is_pyramid_Response(self):
from pyramid.response import Response
cls = self._getTargetClass()
self.assertEqual(cls.ResponseClass, Response)

def test_charset_defaults_to_utf8(self):
r = self._makeOne({'PATH_INFO':'/'})
self.assertEqual(r.charset, 'UTF-8')
Expand Down

0 comments on commit 487cb60

Please sign in to comment.