[ckan-changes] commit/ckan: dread: [tests][xs]: Pylons controller fix useful for rendering current template. (Used in dgu extension tests.)

Bitbucket commits-noreply at bitbucket.org
Thu Nov 10 10:41:40 UTC 2011


1 new commit in ckan:


https://bitbucket.org/okfn/ckan/changeset/e6fa34c16b4e/
changeset:   e6fa34c16b4e
user:        dread
date:        2011-11-10 11:40:27
summary:     [tests][xs]: Pylons controller fix useful for rendering current template. (Used in dgu extension tests.)
affected #:  1 file

diff -r 2daf17782fda441485dd506c292b7f3f45811cf8 -r e6fa34c16b4e3beb8670c684faf033b5a3cc2869 ckan/tests/pylons_controller.py
--- a/ckan/tests/pylons_controller.py
+++ b/ckan/tests/pylons_controller.py
@@ -48,3 +48,11 @@
         mapper = make_map()
         cls.registry.register(pylons.url, URLGenerator(mapper, {}))
         cls.registry.register(pylons.session, TestSession())
+
+        # Templates often want to find out the request's routes info, so put
+        # some dummy values into the routes_dict, so the templates that do
+        # this don't cause an exception.
+        pylons.request.environ.update({'pylons.routes_dict': {
+            'action': 'test-action',
+            'controller': 'test-package::',
+        }})

Repository URL: https://bitbucket.org/okfn/ckan/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.




More information about the ckan-changes mailing list