def METHOD_NAME(self, name, template_class):
    """Register a template by (entry point) name at runtime"""
    self._check_existing_entry_point('template', name)
    try:
        assert issubclass(template_class, DocumentTemplate)
    except (TypeError, AssertionError):
        raise ValueError("The template '{}' you are trying to register "
                         "is not a DocumentTemplate subclass".format(name))
    self._templates[name] = template_class