Skip to content

Commit

Permalink
Fix tests for v3
Browse files Browse the repository at this point in the history
  • Loading branch information
fsbraun committed Sep 29, 2024
1 parent 03b83eb commit 86cdbed
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
11 changes: 5 additions & 6 deletions djangocms_text/cms_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -533,13 +533,12 @@ def get_available_urls(self, request):
)
else:
# django CMS 3
qs = [
title.page
for title in PageContent.objects.filter(language=language, title__icontains=search).order_by(
"page__node__path"
qs = list(
PageContent.objects.filter(language=language, title__icontains=search).order_by("page__node__path")
)
]

for page_content in qs:
# Patch the missing get_absolute_url method
page_content.get_absolute_url = lambda: page_content.page.get_absolute_url()
urls = {
"results": [
{
Expand Down
2 changes: 1 addition & 1 deletion tests/test_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def test_invalid_dynamic_link(self):
page.get_absolute_url(),
"/en/page/",
)
dynamic_html = f'<a data-cms-href="cms.page:{page.pk + 1}">Link</a>'
dynamic_html = '<a data-cms-href="cms.page:0">Link</a>'

result = render_dynamic_attributes(dynamic_html)
self.assertEqual(
Expand Down

0 comments on commit 86cdbed

Please sign in to comment.