Commits

Andriy Kornatskyy  committed 92f2473

Add bootstrap warning if render_template option is not defined.

  • Participants
  • Parent commits 4a1768e

Comments (0)

Files changed (2)

File src/wheezy/web/middleware/bootstrap.py

 
 """ ``bootstrap`` module.
 """
+
+from warnings import warn
+
 from wheezy.http import bootstrap_http_defaults
 
 
         if url_mapping:
             path_router.add_routes(url_mapping)
         if 'render_template' not in options:
-            from wheezy.web.templates import MakoTemplate
-            options['render_template'] = MakoTemplate()
+            warn('Bootstrap: render_template is not defined', stacklevel=2)
         if 'translations_manager' not in options:
             from wheezy.core.i18n import TranslationsManager
             options['translations_manager'] = TranslationsManager()

File src/wheezy/web/middleware/tests/test_bootstrap.py

         assert None == bootstrap_defaults({})(options)
 
         required_options = tuple(sorted(options.keys()))
-        assert 13 == len(required_options)
+        assert 12 == len(required_options)
         assert ('AUTH_COOKIE', 'AUTH_COOKIE_DOMAIN', 'AUTH_COOKIE_PATH',
                 'AUTH_COOKIE_SECURE', 'CONTENT_TYPE', 'ENCODING',
                 'RESUBMISSION_NAME', 'XSRF_NAME', 'path_for', 'path_router',
-                'render_template', 'ticket',
-                'translations_manager') == required_options
+                'ticket', 'translations_manager') == required_options
 
     def test_path_router(self):
         """ Ensure required keys exist.