def METHOD_NAME(self):
    def disable_op(arg):
        raise TemplateRuntimeError('that operator so does not work')
    for expr, ctx, rv in ('-1', {}, '-1'), ('-a', {'a': 2}, '-2'):
        env = SandboxedEnvironment()
        env.unop_table['-'] = disable_op
        t = env.from_string('{{ %s }}' % expr)
        assert t.render(ctx) == rv
        env.intercepted_unops = frozenset(['-'])
        t = env.from_string('{{ %s }}' % expr)
        try:
            t.render(ctx)
        except TemplateRuntimeError as e:
            pass
        else:
            self.fail('expected runtime error')