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

Update Django versions #758

Merged
merged 2 commits into from
Sep 15, 2024
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
14 changes: 8 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: test

on: [ push ]
on: [ push, pull_request ]

concurrency:
group: test-${{ github.head_ref }}
Expand All @@ -19,18 +19,20 @@ jobs:
strategy:
matrix:
python-version: [3.8, 3.9, "3.10", 3.11, 3.12]
django-version: [4.2, 5.0, "main"]
django-version: [4.2, 5.0, 5.1, "main"]
exclude:
# Django 4.2
- python-version: 3.12
django-version: 4.2

# Django 5.0
- python-version: 3.8
django-version: 5.0
- python-version: 3.9
django-version: 5.0

# Django 5.1
- python-version: 3.8
django-version: 5.1
- python-version: 3.9
django-version: 5.1

# Django main
- python-version: 3.8
django-version: "main"
Expand Down
2 changes: 1 addition & 1 deletion example/app/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
lines = []
for i in range(200):
lines.append("Line %s" % (i + 1))
lines.append(f"Line {i + 1}")
paginator = Paginator(lines, 10)
page = self.request.GET.get("page")
try:
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap4/renderers.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def parse_size(self, size):
return "large"
if size in ("md", "medium", ""):
return "medium"
raise BootstrapError('Invalid value "%s" for parameter "size" (expected "sm", "md", "lg" or "").' % size)
raise BootstrapError(f'Invalid value "{size}" for parameter "size" (expected "sm", "md", "lg" or "").')

def get_size_class(self, prefix="form-control"):
if self.size == "small":
Expand Down
2 changes: 1 addition & 1 deletion tests/test_formsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def test_field_names(self):
self.assertIn('name="datetime_0"', res)
self.assertIn('name="datetime_1"', res)
else:
self.assertIn('name="%s"' % field.name, res)
self.assertIn(f'name="{field.name}"', res)

def test_field_addons(self):
form = TestForm()
Expand Down
2 changes: 1 addition & 1 deletion tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def render_form(form=None, context=None):

def render_form_field(field, context=None):
"""Create a template that renders a field."""
form_field = "form.%s" % field
form_field = f"form.{field}"
return render_template_with_form("{% bootstrap_field " + form_field + " %}", context)


Expand Down
7 changes: 4 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ args_are_paths = false
envlist =
py38-{4.2},
py39-{4.2},
py310-{4.2,5.0,main},
py311-{4.2,5.0,main},
py312-{4.2,5.0,main},
py310-{4.2,5.0,5.1,main},
py311-{4.2,5.0,5.1,main},
py312-{4.2,5.0,5.1,main},
docs,
lint,

Expand All @@ -26,6 +26,7 @@ commands =
deps =
4.2: Django==4.2.*
5.0: Django==5.0.*
5.1: Django==5.1.*
main: https://github.com/django/django/archive/main.tar.gz
-r{toxinidir}/requirements-test.txt

Expand Down