Repository: django-cms/djangocms-text-ckeditor (language: python)

Issue:
Add official support for Django 3.2



Discussion / hints:

Fix patch:
diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 0a078006e..c3f3e51a4 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -7,6 +7,12 @@ Unreleased
 
 * Add dark mode feature and dark mode patch for skin moono-lisa
 
+4.0.1 (unreleased)
+==================
+
+* Added support for Django 3.2
+
+
 4.0.0 (2020-09-15)
 ==================
 
diff --git a/setup.py b/setup.py
index 23e2b5e33..46530ef78 100644
--- a/setup.py
+++ b/setup.py
@@ -27,10 +27,12 @@
     'Framework :: Django :: 2.2',
     'Framework :: Django :: 3.0',
     'Framework :: Django :: 3.1',
+    'Framework :: Django :: 3.2',
     'Framework :: Django CMS',
     'Framework :: Django CMS :: 3.6',
     'Framework :: Django CMS :: 3.7',
     'Framework :: Django CMS :: 3.8',
+    'Framework :: Django CMS :: 3.9',
     'Topic :: Internet :: WWW/HTTP',
     'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
     'Topic :: Software Development',
diff --git a/tox.ini b/tox.ini
index 6ba71cbbe..60555a665 100644
--- a/tox.ini
+++ b/tox.ini
@@ -6,6 +6,7 @@ envlist =
     py{35,36,37,38}-dj{22}-cms{37,38}
     py{36,37,38}-dj{30}-cms{37,38}
     py{36,37,38}-dj{31}-cms{38}
+    py{36,37,38}-dj{32}-cms{38,39}
 
 skip_missing_interpreters=True
 
@@ -46,8 +47,10 @@ deps =
     dj22: Django>=2.2,<3.0
     dj30: Django>=3.0,<3.1
     dj31: Django>=3.1,<3.2
+    dj32: Django>=3.2,<3.3
     cms37: django-cms>=3.7,<3.8
     cms38: django-cms>=3.8,<3.9
+    cms39: django-cms>=3.9,<3.10
 commands =
     {envpython} --version
     {env:COMMAND:coverage} erase


Test patch:
diff --git a/tests/requirements/dj32_cms38.txt b/tests/requirements/dj32_cms38.txt
new file mode 100644
index 000000000..4c2ed206f
--- /dev/null
+++ b/tests/requirements/dj32_cms38.txt
@@ -0,0 +1,4 @@
+-r base.txt
+
+Django>=3.2,<3.3
+django-cms>=3.8,<3.9
diff --git a/tests/requirements/dj32_cms39.txt b/tests/requirements/dj32_cms39.txt
new file mode 100644
index 000000000..cdd62d4de
--- /dev/null
+++ b/tests/requirements/dj32_cms39.txt
@@ -0,0 +1,4 @@
+-r base.txt
+
+Django>=3.2,<3.3
+django-cms>=3.9,<3.10
diff --git a/tests/test_plugin.py b/tests/test_plugin.py
index 844ee899e..4d7cee3cd 100644
--- a/tests/test_plugin.py
+++ b/tests/test_plugin.py
@@ -123,7 +123,7 @@ def test_add_and_edit_plugin(self):
         Test that you can add a text plugin
         """
         admin = self.get_superuser()
-        simple_page = create_page('test page', 'page.html', u'en')
+        simple_page = create_page('test page', 'page.html', 'en')
         simple_placeholder = get_page_placeholders(simple_page, 'en').get(slot='content')
 
         endpoint = self.get_add_plugin_uri(simple_placeholder, 'TextPlugin')
@@ -175,7 +175,7 @@ def test_add_and_cancel_plugin(self):
         """
         Test that you can add a text plugin
         """
-        simple_page = create_page('test page', 'page.html', u'en')
+        simple_page = create_page('test page', 'page.html', 'en')
         simple_placeholder = get_page_placeholders(simple_page, 'en').get(slot='content')
 
         endpoint = self.get_add_plugin_uri(simple_placeholder, 'TextPlugin')
@@ -228,7 +228,7 @@ def test_copy_referenced_plugins(self):
         Test that copy+pasting a child plugin between text editors
         creates proper copies of the child plugin and messes no other data up
         """
-        simple_page = create_page('test page', 'page.html', u'en')
+        simple_page = create_page('test page', 'page.html', 'en')
         simple_placeholder = get_page_placeholders(simple_page, 'en').get(slot='content')
 
         def _get_text_plugin_with_children():
@@ -296,7 +296,7 @@ def test_add_and_cancel_child_plugin(self):
         Test that you can add a text plugin
         """
         admin = self.get_superuser()
-        simple_page = create_page('test page', 'page.html', u'en')
+        simple_page = create_page('test page', 'page.html', 'en')
         simple_placeholder = get_page_placeholders(simple_page, 'en').get(slot='content')
 
         text_plugin = add_plugin(
@@ -387,7 +387,7 @@ def test_add_and_cancel_child_plugin(self):
     def test_action_token_per_session(self):
         # Assert that a cancel token for the same plugin
         # is different per user session.
-        simple_page = create_page('test page', 'page.html', u'en')
+        simple_page = create_page('test page', 'page.html', 'en')
         simple_placeholder = get_page_placeholders(simple_page, 'en').get(slot='content')
 
         text_plugin = add_plugin(
@@ -410,7 +410,7 @@ def test_action_token_per_session(self):
         self.assertNotEqual(action_token_1, action_token_2)
 
     def test_add_and_cancel_plugin_permissions(self):
-        simple_page = create_page('test page', 'page.html', u'en')
+        simple_page = create_page('test page', 'page.html', 'en')
         simple_placeholder = get_page_placeholders(simple_page, 'en').get(slot='content')
 
         endpoint = self.get_add_plugin_uri(simple_placeholder, 'TextPlugin')
@@ -452,7 +452,7 @@ def test_change_form_has_rendered_plugin_content(self):
         the child plugins are rendered as their contents passed
         as initial data to the text field.
         """
-        simple_page = create_page('test page', 'page.html', u'en')
+        simple_page = create_page('test page', 'page.html', 'en')
         simple_placeholder = get_page_placeholders(simple_page, 'en').get(slot='content')
 
         text_plugin = add_plugin(
@@ -498,7 +498,7 @@ def test_user_cant_edit_child_plugins_directly(self):
         No user regardless of permissions can modify the contents
         of a child plugin directly in the text plugin text.
         """
-        simple_page = create_page('test page', 'page.html', u'en')
+        simple_page = create_page('test page', 'page.html', 'en')
         simple_placeholder = get_page_placeholders(simple_page, 'en').get(slot='content')
 
         text_plugin = add_plugin(
@@ -534,7 +534,7 @@ def test_user_cant_edit_child_plugins_directly(self):
             self.assertXMLEqual(text_plugin.body, expected_text)
 
     def test_render_child_plugin_endpoint(self):
-        simple_page = create_page('test page', 'page.html', u'en')
+        simple_page = create_page('test page', 'page.html', 'en')
         simple_placeholder = get_page_placeholders(simple_page, 'en').get(slot='content')
         text_plugin = add_plugin(
             simple_placeholder,
@@ -589,7 +589,7 @@ def test_render_child_plugin_endpoint(self):
             self.assertEqual(force_str(response.content), rendered_child_plugin)
 
     def test_render_child_plugin_endpoint_calls_context_processors(self):
-        simple_page = create_page('test page', 'page.html', u'en')
+        simple_page = create_page('test page', 'page.html', 'en')
         simple_placeholder = get_page_placeholders(simple_page, 'en').get(slot='content')
         text_plugin = add_plugin(
             simple_placeholder,
@@ -629,7 +629,7 @@ def test_render_child_plugin_permissions(self):
         Users can't render a child plugin without change permissions
         on the placeholder attached object and the text plugin.
         """
-        simple_page = create_page('test page', 'page.html', u'en')
+        simple_page = create_page('test page', 'page.html', 'en')
         simple_placeholder = get_page_placeholders(simple_page, 'en').get(slot='content')
         text_plugin = add_plugin(
             simple_placeholder,
@@ -656,7 +656,7 @@ def test_render_child_plugin_token_validation(self):
         was created in the current session and it's text plugin
         matches the child plugin parent.
         """
-        simple_page = create_page('test page', 'page.html', u'en')
+        simple_page = create_page('test page', 'page.html', 'en')
         simple_placeholder = get_page_placeholders(simple_page, 'en').get(slot='content')
         text_plugin = add_plugin(
             simple_placeholder,
@@ -705,7 +705,7 @@ def test_render_child_plugin_token_validation(self):
             self.assertEqual(force_str(response.content), 'Unable to process your request.')
 
     def test_custom_ckeditor_body_css_classes(self):
-        simple_page = create_page('test page', 'page.html', u'en')
+        simple_page = create_page('test page', 'page.html', 'en')
         simple_placeholder = get_page_placeholders(simple_page, 'en').get(slot='content')
 
         parent_plugin = add_plugin(
@@ -735,7 +735,7 @@ def test_custom_ckeditor_body_css_classes(self):
             self.assertContains(response, DummyChildPlugin.child_ckeditor_body_css_class)
 
     def test_render_plugin(self):
-        simple_page = create_page('test page', 'page.html', u'en')
+        simple_page = create_page('test page', 'page.html', 'en')
         simple_placeholder = get_page_placeholders(simple_page, 'en').get(slot='content')
         text_plugin = self._add_text_plugin(simple_placeholder)
 
@@ -758,7 +758,7 @@ def test_render_plugin(self):
             self.assertTrue('LinkPlugin record %d' % i in rendered)
 
     def test_render_extended_plugin(self):
-        simple_page = create_page('test page', 'page.html', u'en')
+        simple_page = create_page('test page', 'page.html', 'en')
         simple_placeholder = get_page_placeholders(simple_page, 'en').get(slot='content')
         text_plugin = self._add_text_plugin(simple_placeholder, 'ExtendedTextPlugin')
 
@@ -784,7 +784,7 @@ def test_copy_plugin_integrity(self):
         """
         Test that copying of textplugins replaces references to copied plugins
         """
-        simple_page = create_page('test page', 'page.html', u'en')
+        simple_page = create_page('test page', 'page.html', 'en')
         simple_placeholder = get_page_placeholders(simple_page, 'en').get(slot='content')
 
         text_plugin = self._add_text_plugin(simple_placeholder)
@@ -837,7 +837,7 @@ def test_copy_plugin_integrity(self):
             self.assertEqual(idlist, expected)
 
     def test_copy_plugin_callback(self):
-        simple_page = create_page('test page', 'page.html', u'en')
+        simple_page = create_page('test page', 'page.html', 'en')
         simple_placeholder = get_page_placeholders(simple_page, 'en').get(slot='content')
 
         text_plugin_1 = self._add_text_plugin(simple_placeholder)
@@ -890,7 +890,7 @@ def test_plugin_tags_to_id_list(self):
             self.assertEqual(plugin_tags_to_id_list(markup), expected)
 
     def test_text_plugin_xss(self):
-        page = create_page('test page', 'page.html', u'en')
+        page = create_page('test page', 'page.html', 'en')
         placeholder = get_page_placeholders(page, 'en').get(slot='content')
         plugin = add_plugin(placeholder, 'TextPlugin', 'en', body='body')
         endpoint = self.get_change_plugin_uri(plugin)