fix unit tests

This commit is contained in:
Jan Suhr 2025-07-28 09:38:43 +02:00
parent 9bbe983207
commit f74bf47e70

View File

@ -23,9 +23,12 @@ try:
class Context(SandboxedEnvironment.context_class):
def resolve_or_missing(self, key):
res = super().resolve_or_missing(key)
if not isinstance(res, Undefined):
if res is not Undefined:
return res
try:
return self.parent["ref"](key)
except KeyError:
return Undefined()
class Environment(SandboxedEnvironment):
context_class = Context