Commits

Andriy Kornatskyy  committed ecaf1aa

Taking ENCODING options into account as required.

  • Participants
  • Parent commits 12645b8

Comments (0)

Files changed (1)

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

 import unittest
 
 from mock import Mock
+from mock import patch
 
 
 class BootstrapWebDefaultsTestCase(unittest.TestCase):
     """ Test the ``bootstrap_defaults``.
     """
 
+    def setUp(self):
+        from wheezy.web.middleware import bootstrap
+        self.patcher = patch.object(bootstrap, 'bootstrap_http_defaults')
+        self.patcher.start()
+
+    def tearDown(self):
+        self.patcher.stop()
+
     def test_default_options(self):
         """ Ensure required keys exist.
         """
-        from wheezy.http import bootstrap_http_defaults
         from wheezy.web.middleware.bootstrap import bootstrap_defaults
         options = {}
-        bootstrap_http_defaults(options)
-        http_required_options = set(options.keys())
 
         assert None == bootstrap_defaults({})(options)
 
-        required_options = tuple(sorted(
-            set(options.keys()) - http_required_options))
-        print(required_options)
-        assert 12 == len(required_options)
+        required_options = tuple(sorted(options.keys()))
+        assert 13 == len(required_options)
         assert ('AUTH_COOKIE', 'AUTH_COOKIE_DOMAIN', 'AUTH_COOKIE_PATH',
-                'AUTH_COOKIE_SECURE', 'CONTENT_TYPE',
+                'AUTH_COOKIE_SECURE', 'CONTENT_TYPE', 'ENCODING',
                 'RESUBMISSION_NAME', 'XSRF_NAME', 'path_for', 'path_router',
                 'render_template', 'ticket',
                 'translations_manager') == required_options