Skip to content

Commit

Permalink
Add Django 3.2 to tests (#583)
Browse files Browse the repository at this point in the history
* Add Django 3.2 into tests

* Prepare CHANGELOG for 4.0.1 release

* Fix unicode strings

* Add Django 3.2 into GitHub CI
  • Loading branch information
DmytroLitvinov authored Mar 8, 2022
1 parent b955396 commit 5dd2974
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 18 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)
==================

Expand Down
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
4 changes: 4 additions & 0 deletions tests/requirements/dj32_cms38.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-r base.txt

Django>=3.2,<3.3
django-cms>=3.8,<3.9
4 changes: 4 additions & 0 deletions tests/requirements/dj32_cms39.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-r base.txt

Django>=3.2,<3.3
django-cms>=3.9,<3.10
36 changes: 18 additions & 18 deletions tests/test_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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')
Expand Down Expand Up @@ -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():
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand All @@ -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')
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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)

Expand All @@ -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')

Expand All @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 5dd2974

Please sign in to comment.