Skip to content

Commit

Permalink
fix: Test compatibility with django CMS 5 (#453)
Browse files Browse the repository at this point in the history
* fix: Test compatibility with django CMS 5

* Update tests/test_integration_with_core.py
  • Loading branch information
fsbraun authored Mar 4, 2025
1 parent 6cd61a4 commit bf89036
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/test_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def test_delete_plugin(self):

with self.login_user_context(self.get_superuser()):
response = self.client.post(endpoint, data)
self.assertEqual(response.status_code, 302)
self.assertIn(response.status_code, (200, 302)) # 302 for django CMS < 5

version = Version.objects.get(pk=version.pk)
self.assertEqual(version.modified, dt)
Expand Down
6 changes: 5 additions & 1 deletion tests/test_integration_with_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,11 @@ def setUp(self):
content__language="fr",
state=constants.ARCHIVED,
)
self.page.languages = "en,fr"
try:
self.page.languages = "en,fr"
except AttributeError:
# The property does not have a setter in django CMS 5+
pass
self.page.save()


Expand Down

0 comments on commit bf89036

Please sign in to comment.