Skip to content
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

Bump django from 3.2.22 to 3.2.23 in /tests/requirements #143

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ Use 'x' to check each item: [x] I have ...
* [ ] I have opened this pull request against ``master``
* [ ] I have added or modified the tests when changing logic
* [ ] I have followed [the conventional commits guidelines](https://www.conventionalcommits.org/) to add meaningful information into the changelog
* [ ] I have read the [contribution guidelines ](https://github.com/django-cms/django-cms/blob/develop/CONTRIBUTING.rst) and I have joined #workgroup-pr-review on
* [ ] I have read the [contribution guidelines ](https://github.com/django-cms/django-cms/blob/develop/CONTRIBUTING.rst) and I have joined #workgroup-pr-review on
[Slack](https://www.django-cms.org/slack) to find a “pr review buddy” who is going to review my pull request.
14 changes: 7 additions & 7 deletions aldryn_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ class Form(forms.BaseForm):
required=False,
)
enable_search = forms.CheckboxField(
'Enable snippet content to be searchable.',
"Enable snippet content to be searchable.",
required=False,
initial=False,
)

def to_settings(self, data, settings):
if data['editor_theme']:
settings['DJANGOCMS_SNIPPET_THEME'] = data['editor_theme']
if data['editor_mode']:
settings['DJANGOCMS_SNIPPET_MODE'] = data['editor_mode']
if data['enable_search']:
settings['DJANGOCMS_SNIPPET_SEARCH'] = data['enable_search']
if data["editor_theme"]:
settings["DJANGOCMS_SNIPPET_THEME"] = data["editor_theme"]
if data["editor_mode"]:
settings["DJANGOCMS_SNIPPET_MODE"] = data["editor_mode"]
if data["enable_search"]:
settings["DJANGOCMS_SNIPPET_SEARCH"] = data["enable_search"]
return settings
6 changes: 3 additions & 3 deletions tests/requirements/py310-django32-cms311.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ dj-database-url==2.1.0 \
--hash=sha256:04bc34b248d4c21aaa13e4ab419ae6575ef5f10f3df735ce7da97722caa356e0 \
--hash=sha256:f2042cefe1086e539c9da39fad5ad7f61173bf79665e69bf7e4de55fa88b135f
# via django-app-helper
django==3.2.22 \
--hash=sha256:83b6d66b06e484807d778263fdc7f9186d4dc1862fcfa6507830446ac6b060ba \
--hash=sha256:c5e7b668025a6e06cad9ba6d4de1fd1a21212acebb51ea34abb400c6e4d33430
django==3.2.23 \
--hash=sha256:82968f3640e29ef4a773af2c28448f5f7a08d001c6ac05b32d02aeee6509508b \
--hash=sha256:d48608d5f62f2c1e260986835db089fa3b79d6f58510881d316b8d88345ae6e1
# via dj-database-url
django-app-helper==3.3.2 \
--hash=sha256:67b34ce92eed58dce8d44056ff038a253766b660a5a240fcf408fdd33da57a8b \
Expand Down
6 changes: 3 additions & 3 deletions tests/requirements/py310-django42-cms311.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ dj-database-url==2.1.0 \
--hash=sha256:04bc34b248d4c21aaa13e4ab419ae6575ef5f10f3df735ce7da97722caa356e0 \
--hash=sha256:f2042cefe1086e539c9da39fad5ad7f61173bf79665e69bf7e4de55fa88b135f
# via django-app-helper
django==4.2.6 \
--hash=sha256:08f41f468b63335aea0d904c5729e0250300f6a1907bf293a65499496cdbc68f \
--hash=sha256:a64d2487cdb00ad7461434320ccc38e60af9c404773a2f95ab0093b4453a3215
django==3.2.23 \
--hash=sha256:82968f3640e29ef4a773af2c28448f5f7a08d001c6ac05b32d02aeee6509508b \
--hash=sha256:d48608d5f62f2c1e260986835db089fa3b79d6f58510881d316b8d88345ae6e1
# via dj-database-url
django-app-helper==3.3.2 \
--hash=sha256:67b34ce92eed58dce8d44056ff038a253766b660a5a240fcf408fdd33da57a8b \
Expand Down
6 changes: 3 additions & 3 deletions tests/requirements/py311-django32-cms311.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ dj-database-url==2.1.0 \
--hash=sha256:04bc34b248d4c21aaa13e4ab419ae6575ef5f10f3df735ce7da97722caa356e0 \
--hash=sha256:f2042cefe1086e539c9da39fad5ad7f61173bf79665e69bf7e4de55fa88b135f
# via django-app-helper
django==3.2.22 \
--hash=sha256:83b6d66b06e484807d778263fdc7f9186d4dc1862fcfa6507830446ac6b060ba \
--hash=sha256:c5e7b668025a6e06cad9ba6d4de1fd1a21212acebb51ea34abb400c6e4d33430
django==3.2.23 \
--hash=sha256:82968f3640e29ef4a773af2c28448f5f7a08d001c6ac05b32d02aeee6509508b \
--hash=sha256:d48608d5f62f2c1e260986835db089fa3b79d6f58510881d316b8d88345ae6e1
# via dj-database-url
django-app-helper==3.3.2 \
--hash=sha256:67b34ce92eed58dce8d44056ff038a253766b660a5a240fcf408fdd33da57a8b \
Expand Down
6 changes: 3 additions & 3 deletions tests/requirements/py311-django42-cms311.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ dj-database-url==2.1.0 \
--hash=sha256:04bc34b248d4c21aaa13e4ab419ae6575ef5f10f3df735ce7da97722caa356e0 \
--hash=sha256:f2042cefe1086e539c9da39fad5ad7f61173bf79665e69bf7e4de55fa88b135f
# via django-app-helper
django==4.2.6 \
--hash=sha256:08f41f468b63335aea0d904c5729e0250300f6a1907bf293a65499496cdbc68f \
--hash=sha256:a64d2487cdb00ad7461434320ccc38e60af9c404773a2f95ab0093b4453a3215
django==3.2.23 \
--hash=sha256:82968f3640e29ef4a773af2c28448f5f7a08d001c6ac05b32d02aeee6509508b \
--hash=sha256:d48608d5f62f2c1e260986835db089fa3b79d6f58510881d316b8d88345ae6e1
# via dj-database-url
django-app-helper==3.3.2 \
--hash=sha256:67b34ce92eed58dce8d44056ff038a253766b660a5a240fcf408fdd33da57a8b \
Expand Down
6 changes: 3 additions & 3 deletions tests/requirements/py39-django32-cms311.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ dj-database-url==2.1.0 \
--hash=sha256:04bc34b248d4c21aaa13e4ab419ae6575ef5f10f3df735ce7da97722caa356e0 \
--hash=sha256:f2042cefe1086e539c9da39fad5ad7f61173bf79665e69bf7e4de55fa88b135f
# via django-app-helper
django==3.2.22 \
--hash=sha256:83b6d66b06e484807d778263fdc7f9186d4dc1862fcfa6507830446ac6b060ba \
--hash=sha256:c5e7b668025a6e06cad9ba6d4de1fd1a21212acebb51ea34abb400c6e4d33430
django==3.2.23 \
--hash=sha256:82968f3640e29ef4a773af2c28448f5f7a08d001c6ac05b32d02aeee6509508b \
--hash=sha256:d48608d5f62f2c1e260986835db089fa3b79d6f58510881d316b8d88345ae6e1
# via dj-database-url
django-app-helper==3.3.2 \
--hash=sha256:67b34ce92eed58dce8d44056ff038a253766b660a5a240fcf408fdd33da57a8b \
Expand Down
6 changes: 3 additions & 3 deletions tests/requirements/py39-django42-cms311.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ dj-database-url==2.1.0 \
--hash=sha256:04bc34b248d4c21aaa13e4ab419ae6575ef5f10f3df735ce7da97722caa356e0 \
--hash=sha256:f2042cefe1086e539c9da39fad5ad7f61173bf79665e69bf7e4de55fa88b135f
# via django-app-helper
django==4.2.6 \
--hash=sha256:08f41f468b63335aea0d904c5729e0250300f6a1907bf293a65499496cdbc68f \
--hash=sha256:a64d2487cdb00ad7461434320ccc38e60af9c404773a2f95ab0093b4453a3215
django==3.2.23 \
--hash=sha256:82968f3640e29ef4a773af2c28448f5f7a08d001c6ac05b32d02aeee6509508b \
--hash=sha256:d48608d5f62f2c1e260986835db089fa3b79d6f58510881d316b8d88345ae6e1
# via dj-database-url
django-app-helper==3.3.2 \
--hash=sha256:67b34ce92eed58dce8d44056ff038a253766b660a5a240fcf408fdd33da57a8b \
Expand Down
25 changes: 14 additions & 11 deletions tests/settings.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
#!/usr/bin/env python
HELPER_SETTINGS = {
'INSTALLED_APPS': [
'tests.utils',
"INSTALLED_APPS": [
"tests.utils",
],
'CMS_LANGUAGES': {
1: [{
'code': 'en',
'name': 'English',
}]
"CMS_LANGUAGES": {
1: [
{
"code": "en",
"name": "English",
}
]
},
'LANGUAGE_CODE': 'en',
'ALLOWED_HOSTS': ['localhost'],
"LANGUAGE_CODE": "en",
"ALLOWED_HOSTS": ["localhost"],
}


def run():
from app_helper import runner
runner.cms('djangocms_snippet')

runner.cms("djangocms_snippet")

if __name__ == '__main__':

if __name__ == "__main__":
run()
17 changes: 8 additions & 9 deletions tests/test_migrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,23 @@


class MigrationTestCase(TestCase):

@override_settings(MIGRATION_MODULES={})
def test_for_missing_migrations(self):
output = StringIO()
options = {
'interactive': False,
'dry_run': True,
'stdout': output,
'check_changes': True,
"interactive": False,
"dry_run": True,
"stdout": output,
"check_changes": True,
}

try:
call_command('makemigrations', **options)
call_command("makemigrations", **options)
except SystemExit as e:
status_code = str(e)
else:
# the "no changes" exit code is 0
status_code = '0'
status_code = "0"

if status_code == '1':
self.fail('There are missing migrations:\n {}'.format(output.getvalue()))
if status_code == "1":
self.fail(f"There are missing migrations:\n {output.getvalue()}")
1 change: 0 additions & 1 deletion tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class SnippetModelTestCase(TestCase):

def setUp(self):
pass

Expand Down
34 changes: 25 additions & 9 deletions tests/test_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@


class SnippetPluginsTestCase(CMSTestCase):

def setUp(self):
self.language = "en"
self.home = create_page(
Expand All @@ -29,7 +28,9 @@ def tearDown(self):
self.superuser.delete()

def test_html_rendering(self):
request_url = self.page.get_absolute_url(self.language) + "?toolbar_off=true"
request_url = (
self.page.get_absolute_url(self.language) + "?toolbar_off=true"
)
snippet = Snippet.objects.create(
name="plugin_snippet",
html="<p>Hello World</p>",
Expand All @@ -52,7 +53,9 @@ def test_html_rendering(self):
self.assertIn(b"<p>Hello World</p>", response.content)

def test_failing_html_rendering(self):
request_url = self.page.get_absolute_url(self.language) + "?toolbar_off=true"
request_url = (
self.page.get_absolute_url(self.language) + "?toolbar_off=true"
)
snippet = Snippet.objects.create(
name="plugin_snippet",
html="{% import weirdness %}",
Expand All @@ -70,10 +73,14 @@ def test_failing_html_rendering(self):
response = self.client.get(request_url)

self.assertContains(response, "Invalid block tag on line 1")
self.assertContains(response, "Did you forget to register or load this tag?")
self.assertContains(
response, "Did you forget to register or load this tag?"
)

def test_template_rendering(self):
request_url = self.page.get_absolute_url(self.language) + "?toolbar_off=true"
request_url = (
self.page.get_absolute_url(self.language) + "?toolbar_off=true"
)
template = "snippet.html"
snippet = Snippet.objects.create(
name="plugin_snippet",
Expand All @@ -94,13 +101,22 @@ def test_template_rendering(self):
with self.login_user_context(self.superuser):
response = self.client.get(request_url)

self.assertNotIn("Template {} does not exist".format(template).encode(), response.content)
self.assertNotIn(b"context must be a dict rather than Context", response.content)
self.assertNotIn(b"context must be a dict rather than PluginContext", response.content)
self.assertNotIn(
f"Template {template} does not exist".encode(), response.content
)
self.assertNotIn(
b"context must be a dict rather than Context", response.content
)
self.assertNotIn(
b"context must be a dict rather than PluginContext",
response.content,
)
self.assertContains(response, "<p>Hello World Template</p>")

def test_failing_template_rendering(self):
request_url = self.page.get_absolute_url(self.language) + "?toolbar_off=true"
request_url = (
self.page.get_absolute_url(self.language) + "?toolbar_off=true"
)
template = "some_template"
snippet = Snippet.objects.create(
name="plugin_snippet",
Expand Down
36 changes: 15 additions & 21 deletions tests/test_templatetags.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@


class SnippetTemplateTagTestCase(TestCase):

def test_html_rendered(self):
snippet = Snippet.objects.create(
name="test snippet",
Expand All @@ -20,17 +19,15 @@ def test_html_rendered(self):

context = Context({"title": "world"})
template_to_render = Template(
'{% load snippet_tags %}'
'{% snippet_fragment "test_snippet" %}'
"{% load snippet_tags %}" '{% snippet_fragment "test_snippet" %}'
)
rendered_template = template_to_render.render(context)
self.assertInHTML('<p>hello world</p>', rendered_template)
self.assertInHTML("<p>hello world</p>", rendered_template)

# test html errors
context = Context({"title": "world"})
template_to_render = Template(
'{% load snippet_tags %}'
'{% snippet_fragment "test_snippet_2" %}'
"{% load snippet_tags %}" '{% snippet_fragment "test_snippet_2" %}'
)
with self.assertRaises(ObjectDoesNotExist):
# Snippet matching query does not exist.
Expand All @@ -50,29 +47,27 @@ def test_template_rendered(self):
# use a string to identify
context = Context({})
template_to_render = Template(
'{% load snippet_tags %}'
'{% snippet_fragment "test_snippet" %}'
"{% load snippet_tags %}" '{% snippet_fragment "test_snippet" %}'
)
rendered_template = template_to_render.render(context)
self.assertInHTML('<p>Hello World Template</p>', rendered_template)
self.assertInHTML("<p>Hello World Template</p>", rendered_template)

# use an id to identify
context = Context({})
template_to_render = Template(
'{% load snippet_tags %}'
'{% snippet_fragment 1 %}'
"{% load snippet_tags %}" "{% snippet_fragment 1 %}"
)
rendered_template = template_to_render.render(context)
self.assertInHTML('<p>Hello World Template</p>', rendered_template)
self.assertInHTML("<p>Hello World Template</p>", rendered_template)

# tests "or" functionality
context = Context({})
template_to_render = Template(
'{% load snippet_tags %}'
"{% load snippet_tags %}"
'{% snippet_fragment "test_snippet_1" or %}<p>hello world</p>{% endsnippet_fragment %}'
)
rendered_template = template_to_render.render(context)
self.assertInHTML('<p>hello world</p>', rendered_template)
self.assertInHTML("<p>hello world</p>", rendered_template)

def test_template_errors(self):
template = "does_not_exist.html"
Expand All @@ -87,16 +82,16 @@ def test_template_errors(self):

context = Context({})
template_to_render = Template(
'{% load snippet_tags %}'
'{% snippet_fragment "test_snippet" %}'
"{% load snippet_tags %}" '{% snippet_fragment "test_snippet" %}'
)
rendered_template = template_to_render.render(context)
self.assertIn('Template does_not_exist.html does not exist.', rendered_template)
self.assertIn(
"Template does_not_exist.html does not exist.", rendered_template
)

context = Context({})
template_to_render = Template(
'{% load snippet_tags %}'
'{% snippet_fragment "test_snippet_1" %}'
"{% load snippet_tags %}" '{% snippet_fragment "test_snippet_1" %}'
)
with self.assertRaises(ObjectDoesNotExist):
# Snippet object does not exist
Expand All @@ -106,6 +101,5 @@ def test_template_errors(self):
with self.assertRaises(TemplateSyntaxError):
# You need to specify at least a "snippet" ID, slug or instance
template_to_render = Template(
'{% load snippet_tags %}'
'{% snippet_fragment %}'
"{% load snippet_tags %}" "{% snippet_fragment %}"
)
Loading