Skip to content

feat: Add support for djangocms v4 #140

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions tests/requirements/compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,20 @@
from subprocess import run

CONFIG_MATRIX = [
["python3.9", "Django>=3.2a1,<3.3", "django-cms>=3.8,<3.9", "py39-django32-cms38.txt",],
["python3.9", "Django>=3.2a1,<3.3", "django-cms>=3.9,<3.10", "py39-django32-cms39.txt",],
["python3.9", "Django>=3.2a1,<3.3", "django-cms>=3.10,<3.11", "py39-django32-cms310.txt",],
["python3.9", "Django>=4.2,<5.0", "django-cms>=3.11,<4.0", "py39-django42-cms311.txt",],
["python3.9", "Django>=4.2,<5.0", "django-cms>=4.1,<5.0.0a1", "py39-django42-cms41.txt",],

["python3.10", "Django>=3.2a1,<3.3", "django-cms>=3.8,<3.9", "py310-django32-cms38.txt",],
["python3.10", "Django>=3.2a1,<3.3", "django-cms>=3.9,<3.10", "py310-django32-cms39.txt",],
["python3.10", "Django>=3.2a1,<3.3", "django-cms>=3.10,<3.11", "py310-django32-cms310.txt",],
["python3.10", "Django>=4.2a1,<5.0", "django-cms>=3.11,<4.0", "py310-django42-cms311.txt",],
["python3.10", "Django>=4.2,<5.0", "django-cms>=3.11,<4.0", "py310-django42-cms311.txt",],
["python3.10", "Django>=4.2,<5.0", "django-cms>=4.1,<5.0.0a1", "py310-django42-cms41.txt",],

["python3.11", "Django>=4.2a1,<5.0", "django-cms>=3.11,<4.0", "py311-django42-cms311.txt",],
["python3.11", "Django>=4.2,<5.0", "django-cms>=3.11,<4.0", "py311-django42-cms311.txt",],
["python3.11", "Django>=4.2,<5.0", "django-cms>=4.1,<5.0.0a1", "py311-django42-cms41.txt",],

["python3.12", "Django>=4.2,<5.0", "django-cms>=3.11,<4.0", "py312-django42-cms311.txt",],
["python3.12", "Django>=4.2,<5.0", "django-cms>=4.1,<5.0.0a1", "py312-django42-cms41.txt",],

["python3.13", "Django>=4.2,<5.0", "django-cms>=3.11,<4.0", "py313-django42-cms311.txt",],
["python3.13", "Django>=4.2,<5.0", "django-cms>=4.1,<5.0.0a1", "py313-django42-cms41.txt",],
]

if __name__ == "__main__":
Expand Down
409 changes: 0 additions & 409 deletions tests/requirements/py310-django32-cms310.txt

This file was deleted.

410 changes: 0 additions & 410 deletions tests/requirements/py310-django32-cms38.txt

This file was deleted.

409 changes: 0 additions & 409 deletions tests/requirements/py310-django32-cms39.txt

This file was deleted.

500 changes: 500 additions & 0 deletions tests/requirements/py310-django42-cms41.txt

Large diffs are not rendered by default.

453 changes: 453 additions & 0 deletions tests/requirements/py311-django42-cms41.txt

Large diffs are not rendered by default.

447 changes: 447 additions & 0 deletions tests/requirements/py312-django42-cms311.txt

Large diffs are not rendered by default.

453 changes: 453 additions & 0 deletions tests/requirements/py312-django42-cms41.txt

Large diffs are not rendered by default.

447 changes: 447 additions & 0 deletions tests/requirements/py313-django42-cms311.txt

Large diffs are not rendered by default.

453 changes: 453 additions & 0 deletions tests/requirements/py313-django42-cms41.txt

Large diffs are not rendered by default.

409 changes: 0 additions & 409 deletions tests/requirements/py39-django32-cms310.txt

This file was deleted.

410 changes: 0 additions & 410 deletions tests/requirements/py39-django32-cms38.txt

This file was deleted.

409 changes: 0 additions & 409 deletions tests/requirements/py39-django32-cms39.txt

This file was deleted.

494 changes: 494 additions & 0 deletions tests/requirements/py39-django42-cms311.txt

Large diffs are not rendered by default.

500 changes: 500 additions & 0 deletions tests/requirements/py39-django42-cms41.txt

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions tests/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@

THUMBNAIL_DEBUG = True

CMS_CONFIRM_VERSION4 = True

DJANGOCMS_PICTURE_RESPONSIVE_IMAGES = True

DJANGOCMS_PICTURE_RESPONSIVE_IMAGES_VIEWPORT_BREAKPOINTS = [576, 768, 992]
Expand Down
13 changes: 8 additions & 5 deletions tests/test_plugins.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from cms import __version__ as cms_version
from cms.api import add_plugin, create_page
from cms.test_utils.testcases import CMSTestCase

Expand All @@ -17,14 +18,18 @@ def setUp(self):
template="page.html",
language=self.language,
)
self.home.publish(self.language)
self.page = create_page(
title="content",
template="page.html",
language=self.language,
)
self.page.publish(self.language)
self.placeholder = self.page.placeholders.get(slot="content")
if cms_version < '4':
self.home.publish(self.language)
self.page.publish(self.language)
self.placeholder = self.page.placeholders.get(slot="content")
else:
self.placeholder = self.page.get_placeholders(self.language).get(slot="content")

self.superuser = self.get_superuser()

def tearDown(self):
Expand Down Expand Up @@ -52,7 +57,6 @@ def test_plugin_structure(self):
language=self.language,
picture=self.picture,
)
self.page.publish(self.language)
self.assertEqual(plugin.get_plugin_class_instance().name, "Image")

with self.login_user_context(self.superuser):
Expand All @@ -68,7 +72,6 @@ def test_plugin_structure(self):
picture=self.picture,
alignment=get_alignment()[1][0],
)
self.page.publish(self.language)

self.assertEqual(plugin.get_plugin_class_instance().name, "Image")

Expand Down
5 changes: 1 addition & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ requires =
tox>=4.2
env_list =
ruff
py311-django42-cms311
py310-django42-cms311
py310-django32-cms{38, 39, 310}
py39-django32-cms{38, 39, 310}
py{39,310,311,312,313}-django42-cms{311,41}
skip_missing_interpreters=True

[testenv]
Expand Down