Ejemplo n.º 1
0
    def test_warnings(self):
        """ Ensure warnings are issued.
        """
        from wheezy.web.middleware.bootstrap import bootstrap_defaults
        options = {
            'ticket': None
        }

        assert None == bootstrap_defaults({})(options)
        self.assert_warning('Bootstrap: render_template is not defined')
Ejemplo n.º 2
0
    def test_path_router(self):
        """ Ensure required keys exist.
        """
        from wheezy.web.middleware.bootstrap import bootstrap_defaults
        mock_path_router = Mock()
        options = {
            'path_router': mock_path_router
        }

        assert None == bootstrap_defaults({
            'signin': 'signin'
        })(options)

        assert tuple(options.keys())
Ejemplo n.º 3
0
    def test_default_options(self):
        """ Ensure required keys exist.
        """
        from wheezy.web.middleware.bootstrap import bootstrap_defaults
        options = {}

        assert None == bootstrap_defaults({})(options)

        required_options = tuple(sorted(options.keys()))
        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',
                'ticket', 'translations_manager') == required_options