Exemple #1
0
    def test_default(self, Form, configure_zpt_renderer):
        from pyramid_deform import includeme

        config = Mock()
        config.registry.settings = {}
        includeme(config)

        assert config.add_translation_dirs.call_count == 1
        assert config.add_static_view.call_count == 1
        configure_zpt_renderer.assert_called_with([])
Exemple #2
0
    def test_template_search_path(self, Form, configure_zpt_renderer):
        from pyramid_deform import includeme

        config = Mock()
        config.registry.settings = {"pyramid_deform.template_search_path": "this-path"}
        includeme(config)

        assert config.add_translation_dirs.call_count == 1
        assert config.add_static_view.call_count == 1
        configure_zpt_renderer.assert_called_with(["this-path"])
Exemple #3
0
    def test_default(self, Form, configure_zpt_renderer):
        from pyramid_deform import includeme

        config = Mock()
        config.registry.settings = {}
        includeme(config)

        assert config.add_translation_dirs.call_count == 1
        assert config.add_static_view.call_count == 1
        config.add_static_view.assert_called_with('static-deform', 'deform:static')
        configure_zpt_renderer.assert_called_with([])
Exemple #4
0
    def test_template_search_path(self, Form, configure_zpt_renderer):
        from pyramid_deform import includeme

        config = Mock()
        config.registry.settings = {
            'pyramid_deform.template_search_path': 'this-path',
            }
        includeme(config)

        assert config.add_translation_dirs.call_count == 1
        assert config.add_static_view.call_count == 1
        configure_zpt_renderer.assert_called_with(['this-path'])
Exemple #5
0
    def test_static_path(self, Form, configure_zpt_renderer):
        from pyramid_deform import includeme

        config = Mock()
        config.registry.settings = {
            "pyramid_deform.static_path": "http://some.domain.com/override/path "  # also tests strip
        }
        includeme(config)

        assert config.add_translation_dirs.call_count == 1
        assert config.add_static_view.call_count == 1
        config.add_static_view.assert_called_with("http://some.domain.com/override/path", "deform:static")
        configure_zpt_renderer.assert_called_with([])
Exemple #6
0
    def test_static_path(self, Form, configure_zpt_renderer):
        from pyramid_deform import includeme

        config = Mock()
        config.registry.settings = {
            'pyramid_deform.static_path': 'http://some.domain.com/override/path ', #also tests strip
            }
        includeme(config)

        assert config.add_translation_dirs.call_count == 1
        assert config.add_static_view.call_count == 1
        config.add_static_view.assert_called_with('http://some.domain.com/override/path', 'deform:static')
        configure_zpt_renderer.assert_called_with([])