Ejemplo n.º 1
0
    def get_template(self, context):
        """
        Get this action's template instance, bound in the context.

        :rtype: shuup.notify.template.Template
        """

        data = self.data.get("template_data")
        if not data:
            raise ValueError("Error! No template data in action.")
        return Template(context, data=data)
def get_test_template():
    ctx = Context.from_variables(name=u"Sir Test")
    template = Template(ctx, TEST_TEMPLATE_DATA)
    return template