Skip to content

Commit

Permalink
test: Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
marksweb committed Oct 26, 2023
1 parent 436b13e commit dbf8a0a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ npm-debug.log
package-lock.json

local.sqlite
.coverage*
6 changes: 5 additions & 1 deletion src/djangocms_snippet/templatetags/snippet_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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:
Expand Down

0 comments on commit dbf8a0a

Please sign in to comment.