Skip to content

ci: pre-commit autoupdate #171

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

Merged
merged 2 commits into from
Feb 21, 2025
Merged
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
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,31 @@ ci:

repos:
- repo: https://github.com/asottile/pyupgrade
rev: v3.17.0
rev: v3.19.1
hooks:
- id: pyupgrade
args: ["--py38-plus"]

- repo: https://github.com/adamchainz/django-upgrade
rev: '1.20.0'
rev: '1.22.2'
hooks:
- id: django-upgrade
args: [--target-version, "3.2"]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.6.3"
rev: "v0.9.4"
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]

- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.6.3
rev: v0.9.4
hooks:
- id: ruff-format

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
Expand Down
4 changes: 2 additions & 2 deletions tests/test_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def test_slug_colomn_should_hyperlinked_with_versioning_disabled(self):
response = self.client.get(self.changelist_url)
self.assertContains(
response,
'<th class="field-slug"><a href="/en/admin/djangocms_snippet/' 'snippet/1/change/">test-snippet</a></th>',
'<th class="field-slug"><a href="/en/admin/djangocms_snippet/snippet/1/change/">test-snippet</a></th>',
)

@skipIf(cms_version < "4", "Django CMS 4 required")
Expand All @@ -251,7 +251,7 @@ def test_name_colomn_should_not_be_hyperlinked_with_versioning_enabled(self):
self.assertContains(response, '<td class="field-name">Test Snippet</td>')
self.assertNotContains(
response,
'<th class="field-slug"><a href="/en/admin/djangocms_snippet/' 'snippet/1/change/">test-snippet</a></th>',
'<th class="field-slug"><a href="/en/admin/djangocms_snippet/snippet/1/change/">test-snippet</a></th>',
)

def test_preview_renders_read_only_fields(self):
Expand Down
8 changes: 4 additions & 4 deletions tests/test_templatetags.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ def test_html_rendered(self):
SnippetPluginFactory(snippet_grouper=snippet_grouper, language=["en"])

context = Context({"title": "world"})
template_to_render = Template("{% load snippet_tags %}" '{% snippet_fragment "test_snippet" %}')
template_to_render = Template('{% load snippet_tags %}{% snippet_fragment "test_snippet" %}')
rendered_template = template_to_render.render(context)

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" %}')
template_to_render = Template('{% load snippet_tags %}{% snippet_fragment "test_snippet_2" %}')
with self.assertRaises(ObjectDoesNotExist):
# Snippet matching query does not exist.
rendered_template = template_to_render.render(context)
Expand All @@ -44,7 +44,7 @@ def test_template_rendered(self):

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

Expand Down Expand Up @@ -76,7 +76,7 @@ def test_template_errors(self):
SnippetPluginFactory(snippet_grouper=snippet_grouper, language=["en"])

context = Context({})
template_to_render = Template("{% load snippet_tags %}" '{% snippet_fragment "test_snippet" %}')
template_to_render = Template('{% 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)

Expand Down