Created
November 7, 2017 17:47
-
-
Save marcinkuzminski/4fdb7de2b38bcba53d1d9e4c5c40c07e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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