Skip to content

Commit bf89036

Browse files
authored
fix: Test compatibility with django CMS 5 (#453)
* fix: Test compatibility with django CMS 5 * Update tests/test_integration_with_core.py
1 parent 6cd61a4 commit bf89036

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

tests/test_handlers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def test_delete_plugin(self):
9393

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

9898
version = Version.objects.get(pk=version.pk)
9999
self.assertEqual(version.modified, dt)

tests/test_integration_with_core.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,11 @@ def setUp(self):
277277
content__language="fr",
278278
state=constants.ARCHIVED,
279279
)
280-
self.page.languages = "en,fr"
280+
try:
281+
self.page.languages = "en,fr"
282+
except AttributeError:
283+
# The property does not have a setter in django CMS 5+
284+
pass
281285
self.page.save()
282286

283287

0 commit comments

Comments
 (0)