##// END OF EJS Templates
events: make sure we propagate our dummy request with proper application_url....
marcink -
r2017:2c6364ff stable
parent child Browse files
Show More
@@ -534,9 +534,13 b' def add_events_routes(config):'
534 534 pattern='/{repo_name}/files/{commit_id}/{f_path}')
535 535
536 536
537 def bootstrap_request():
537 def bootstrap_request(**kwargs):
538 538 import pyramid.testing
539 request = pyramid.testing.DummyRequest()
539 request = pyramid.testing.DummyRequest(**kwargs)
540 request.application_url = kwargs.pop('application_url', 'http://example.com')
541 request.host = kwargs.pop('host', 'example.com:80')
542 request.domain = kwargs.pop('domain', 'example.com')
543
540 544 config = pyramid.testing.setUp(request=request)
541 545 add_events_routes(config)
542 546
@@ -213,7 +213,8 b' class Hooks(object):'
213 213 extras = AttributeDict(extras)
214 214 pylons_router = get_routes_generator_for_server_url(extras.server_url)
215 215 pylons.url._push_object(pylons_router)
216 extras.request = bootstrap_request()
216 extras.request = bootstrap_request(
217 application_url=extras['server_url'])
217 218
218 219 try:
219 220 result = hook(extras)
General Comments 0
You need to be logged in to leave comments. Login now