Skip to content

Instantly share code, notes, and snippets.

@marcinkuzminski
Created November 7, 2017 17:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcinkuzminski/4fdb7de2b38bcba53d1d9e4c5c40c07e to your computer and use it in GitHub Desktop.
Save marcinkuzminski/4fdb7de2b38bcba53d1d9e4c5c40c07e to your computer and use it in GitHub Desktop.
class TestRequest(pyramid.testing.DummyRequest):
application_url = kwargs.pop('application_url', 'http://example.com')
host = kwargs.pop('host', 'example.com:80')
domain = kwargs.pop('domain', 'example.com')
def translate(self, msg):
return msg
def get_partial_renderer(self, tmpl_name):
from rhodecode.lib.partial_renderer import get_partial_renderer
return get_partial_renderer(self, tmpl_name)
class TestDummySession(pyramid.testing.DummySession):
def save(*arg, **kw):
pass
request = TestRequest(**kwargs)
request.session = TestDummySession()
config = pyramid.testing.setUp(request=request)
config.include('pyramid_mako')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment