From dbf8a0af8a5fe1ad689f6a4870fe1aaf6910187b Mon Sep 17 00:00:00 2001 From: Mark Walker Date: Thu, 26 Oct 2023 19:29:43 +0100 Subject: [PATCH] test: Fix tests --- .gitignore | 1 + src/djangocms_snippet/templatetags/snippet_tags.py | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 560c3a09..9fa1d001 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,4 @@ npm-debug.log package-lock.json local.sqlite +.coverage* diff --git a/src/djangocms_snippet/templatetags/snippet_tags.py b/src/djangocms_snippet/templatetags/snippet_tags.py index 5bb506b0..119b5685 100644 --- a/src/djangocms_snippet/templatetags/snippet_tags.py +++ b/src/djangocms_snippet/templatetags/snippet_tags.py @@ -69,6 +69,8 @@ def render(self, context: BaseContext) -> str: """ # Default assume this is directly an instance snippet_instance = self.snippet_id_varname.resolve(context) + + response = self.nodelist.render(context) # Assume this is slug with exceptionless(self.parse_until): if isinstance(snippet_instance, str): @@ -77,10 +79,12 @@ def render(self, context: BaseContext) -> str: elif isinstance(snippet_instance, int): # pragma: no cover snippet_instance = Snippet.objects.get(pk=snippet_instance) - return mark_safe( + response = mark_safe( self.get_content_render(context, snippet_instance) ) + return response + def get_content_render( self, context: BaseContext, instance: Snippet ) -> str: