def check(id, template_path, source):
    """Test a template (before customization).

        id - the id for the collection
        template_path - the template path of the template being customized
        source - the source of the customized template

        This tries a test-compile of the template. If the
        compilation cannot proceed, a CompileError is raised.

        Then tries to render the template with any sample inputs.
        If a rendering fails, a RenderError is raised. In a special
        'data_id' attribute of the error the failing input data is
        indicated.

        If the check succeeds, no exception is raised.
        """
