diff --git a/.github/contributors.json b/.github/contributors.json
index b8ece31a8..c4ad89449 100644
--- a/.github/contributors.json
+++ b/.github/contributors.json
@@ -1613,5 +1613,20 @@
"name": "Kevin Mills",
"github_login": "millsks",
"twitter_username": ""
+ },
+ {
+ "name": "milvagox",
+ "github_login": "milvagox",
+ "twitter_username": "milvagox"
+ },
+ {
+ "name": "Johnny Metz",
+ "github_login": "johnnymetz",
+ "twitter_username": ""
+ },
+ {
+ "name": "Will",
+ "github_login": "novucs",
+ "twitter_username": ""
}
]
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index adde7139b..562c5f500 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -110,6 +110,6 @@ jobs:
run: pip install -r requirements.txt
- uses: actions/setup-node@v4
with:
- node-version: "20"
+ node-version: "22"
- name: Bare Metal ${{ matrix.script.name }}
run: sh tests/test_bare.sh ${{ matrix.script.args }}
diff --git a/.github/workflows/pre-commit-autoupdate.yml b/.github/workflows/pre-commit-autoupdate.yml
index c01cd5141..ebd092859 100644
--- a/.github/workflows/pre-commit-autoupdate.yml
+++ b/.github/workflows/pre-commit-autoupdate.yml
@@ -37,7 +37,7 @@ jobs:
run: pre-commit autoupdate
- name: Create Pull Request
- uses: peter-evans/create-pull-request@v6
+ uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: update/pre-commit-autoupdate
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3c7c1c608..ca9dfe2b3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,6 +3,145 @@ All enhancements and patches to Cookiecutter Django will be documented in this f
+## 2024.09.04
+
+
+### Updated
+
+- Update django-model-utils to 5.0.0 ([#5343](https://github.com/cookiecutter/cookiecutter-django/pull/5343))
+
+## 2024.09.03
+
+
+### Fixed
+
+- Pin watchdog to 4.0.2 ([#5335](https://github.com/cookiecutter/cookiecutter-django/pull/5335))
+
+### Updated
+
+- Update django to 5.0.9 ([#5341](https://github.com/cookiecutter/cookiecutter-django/pull/5341))
+
+- Update sphinx-autobuild to 2024.9.3 ([#5340](https://github.com/cookiecutter/cookiecutter-django/pull/5340))
+
+## 2024.09.02
+
+
+### Updated
+
+- Auto-update pre-commit hooks ([#5334](https://github.com/cookiecutter/cookiecutter-django/pull/5334))
+
+- Update django-allauth to 64.2.0 ([#5337](https://github.com/cookiecutter/cookiecutter-django/pull/5337))
+
+- Update pytest-django to 4.9.0 ([#5338](https://github.com/cookiecutter/cookiecutter-django/pull/5338))
+
+## 2024.08.30
+
+
+### Updated
+
+- Update django-webpack-loader to 3.1.1 ([#5336](https://github.com/cookiecutter/cookiecutter-django/pull/5336))
+
+## 2024.08.29
+
+
+### Updated
+
+- Update ruff to 0.6.3 ([#5333](https://github.com/cookiecutter/cookiecutter-django/pull/5333))
+
+- Update djlint to 1.35.2 ([#5332](https://github.com/cookiecutter/cookiecutter-django/pull/5332))
+
+- Update djlint pre-commit hook to v1.34.2 ([#5331](https://github.com/cookiecutter/cookiecutter-django/pull/5331))
+
+## 2024.08.28
+
+
+### Updated
+
+- Update watchfiles to 0.24.0 ([#5330](https://github.com/cookiecutter/cookiecutter-django/pull/5330))
+
+- Update djlint to 1.34.2 ([#5329](https://github.com/cookiecutter/cookiecutter-django/pull/5329))
+
+## 2024.08.26
+
+
+### Changed
+
+- Check DB migrations in GitHub CI ([#5322](https://github.com/cookiecutter/cookiecutter-django/pull/5322))
+
+### Updated
+
+- Update mypy to 1.11.2 ([#5320](https://github.com/cookiecutter/cookiecutter-django/pull/5320))
+
+## 2024.08.23
+
+
+### Updated
+
+- Update werkzeug to 3.0.4 ([#5313](https://github.com/cookiecutter/cookiecutter-django/pull/5313))
+
+- Update ruff to 0.6.2 ([#5316](https://github.com/cookiecutter/cookiecutter-django/pull/5316))
+
+## 2024.08.22
+
+
+### Updated
+
+- Update django-celery-beat to 2.7.0 ([#5315](https://github.com/cookiecutter/cookiecutter-django/pull/5315))
+
+## 2024.08.21
+
+
+### Changed
+
+- Add type hint for UserFactory ([#5312](https://github.com/cookiecutter/cookiecutter-django/pull/5312))
+
+## 2024.08.20
+
+
+### Fixed
+
+- Add missing extra_body block in allauth entrance.html ([#5308](https://github.com/cookiecutter/cookiecutter-django/pull/5308))
+
+### Updated
+
+- Bump sass-loader from 14.2.1 to 16.0.1 ([#5309](https://github.com/cookiecutter/cookiecutter-django/pull/5309))
+
+- Bump node from 20 to 22 ([#5039](https://github.com/cookiecutter/cookiecutter-django/pull/5039))
+
+- Bump webpack-merge from 5.10.0 to 6.0.1 ([#5187](https://github.com/cookiecutter/cookiecutter-django/pull/5187))
+
+- Bump css-loader from 6.11.0 to 7.1.2 ([#5089](https://github.com/cookiecutter/cookiecutter-django/pull/5089))
+
+- Bump traefik from 2.11.2 to 3.1.2 ([#5282](https://github.com/cookiecutter/cookiecutter-django/pull/5282))
+
+## 2024.08.19
+
+
+### Updated
+
+- Update factory-boy to 3.3.1 ([#5307](https://github.com/cookiecutter/cookiecutter-django/pull/5307))
+
+## 2024.08.17
+
+
+### Updated
+
+- Update ruff to 0.6.1 ([#5303](https://github.com/cookiecutter/cookiecutter-django/pull/5303))
+
+## 2024.08.16
+
+
+### Updated
+
+- Update django-allauth to 64.1.0 ([#5302](https://github.com/cookiecutter/cookiecutter-django/pull/5302))
+
+## 2024.08.15
+
+
+### Updated
+
+- Update ruff to 0.6.0 ([#5300](https://github.com/cookiecutter/cookiecutter-django/pull/5300))
+
## 2024.08.13
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md
index 7309442c0..5010bf32f 100644
--- a/CONTRIBUTORS.md
+++ b/CONTRIBUTORS.md
@@ -1195,6 +1195,13 @@ Listed in alphabetical order.
Will Farley |
diff --git a/requirements.txt b/requirements.txt
index dbaefb342..0e35cc7ea 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -4,9 +4,9 @@ binaryornot==0.4.4
# Code quality
# ------------------------------------------------------------------------------
-ruff==0.5.7
-django-upgrade==1.20.0
-djlint==1.34.1
+ruff==0.6.3
+django-upgrade==1.21.0
+djlint==1.35.2
pre-commit==3.8.0
# Testing
@@ -20,7 +20,7 @@ pyyaml==6.0.2
# Scripting
# ------------------------------------------------------------------------------
-PyGithub==2.3.0
+PyGithub==2.4.0
gitpython==3.1.43
jinja2==3.1.4
requests==2.32.3
diff --git a/setup.py b/setup.py
index 92ec62a3a..eb3b1cc7e 100644
--- a/setup.py
+++ b/setup.py
@@ -5,7 +5,7 @@ except ImportError:
from distutils.core import setup
# We use calendar versioning
-version = "2024.08.13"
+version = "2024.09.04"
with open("README.md") as readme_file:
long_description = readme_file.read()
diff --git a/tests/test_docker.sh b/tests/test_docker.sh
index 473eede04..9811b4fdc 100755
--- a/tests/test_docker.sh
+++ b/tests/test_docker.sh
@@ -24,7 +24,7 @@ docker compose -f docker-compose.local.yml run django mypy my_awesome_project
docker compose -f docker-compose.local.yml run django pytest
# return non-zero status code if there are migrations that have not been created
-docker compose -f docker-compose.local.yml run django python manage.py makemigrations --dry-run --check || { echo "ERROR: there were changes in the models, but migration listed above have not been created and are not saved in version control"; exit 1; }
+docker compose -f docker-compose.local.yml run django python manage.py makemigrations --check || { echo "ERROR: there were changes in the models, but migration listed above have not been created and are not saved in version control"; exit 1; }
# Test support for translations
docker compose -f docker-compose.local.yml run django python manage.py makemessages --all
diff --git a/{{cookiecutter.project_slug}}/.github/workflows/ci.yml b/{{cookiecutter.project_slug}}/.github/workflows/ci.yml
index 5cb9ead4f..0d8ed0cad 100644
--- a/{{cookiecutter.project_slug}}/.github/workflows/ci.yml
+++ b/{{cookiecutter.project_slug}}/.github/workflows/ci.yml
@@ -74,6 +74,9 @@ jobs:
- name: Build the docs
run: docker compose -f docker-compose.docs.yml build docs
+ - name: Check DB Migrations
+ run: docker compose -f docker-compose.local.yml run --rm django python manage.py makemigrations --check
+
- name: Run DB Migrations
run: docker compose -f docker-compose.local.yml run --rm django python manage.py migrate
@@ -98,6 +101,12 @@ jobs:
python -m pip install --upgrade pip
pip install -r requirements/local.txt
+ - name: Check DB Migrations
+ run: python manage.py makemigrations --check
+
+ - name: Run DB Migrations
+ run: python manage.py migrate
+
- name: Test with pytest
run: pytest
{%- endif %}
diff --git a/{{cookiecutter.project_slug}}/.pre-commit-config.yaml b/{{cookiecutter.project_slug}}/.pre-commit-config.yaml
index 16f60ff48..a3d291592 100644
--- a/{{cookiecutter.project_slug}}/.pre-commit-config.yaml
+++ b/{{cookiecutter.project_slug}}/.pre-commit-config.yaml
@@ -39,7 +39,7 @@ repos:
# Run the Ruff linter.
- repo: https://github.com/astral-sh/ruff-pre-commit
- rev: v0.5.7
+ rev: v0.6.3
hooks:
# Linter
- id: ruff
@@ -48,7 +48,7 @@ repos:
- id: ruff-format
- repo: https://github.com/Riverside-Healthcare/djLint
- rev: v1.34.1
+ rev: v1.35.2
hooks:
- id: djlint-reformat-django
files: "templates"
diff --git a/{{cookiecutter.project_slug}}/compose/local/node/Dockerfile b/{{cookiecutter.project_slug}}/compose/local/node/Dockerfile
index 438e3fa08..b0142ff81 100644
--- a/{{cookiecutter.project_slug}}/compose/local/node/Dockerfile
+++ b/{{cookiecutter.project_slug}}/compose/local/node/Dockerfile
@@ -1,4 +1,4 @@
-FROM docker.io/node:20-bookworm-slim
+FROM docker.io/node:22-bookworm-slim
WORKDIR /app
diff --git a/{{cookiecutter.project_slug}}/compose/production/traefik/Dockerfile b/{{cookiecutter.project_slug}}/compose/production/traefik/Dockerfile
index d54bf27ca..2a9b2fdd8 100644
--- a/{{cookiecutter.project_slug}}/compose/production/traefik/Dockerfile
+++ b/{{cookiecutter.project_slug}}/compose/production/traefik/Dockerfile
@@ -1,4 +1,4 @@
-FROM docker.io/traefik:2.11.2
+FROM docker.io/traefik:3.1.2
RUN mkdir -p /etc/traefik/acme \
&& touch /etc/traefik/acme/acme.json \
&& chmod 600 /etc/traefik/acme/acme.json
diff --git a/{{cookiecutter.project_slug}}/package.json b/{{cookiecutter.project_slug}}/package.json
index 0b17e5e0b..a93b3fa5f 100644
--- a/{{cookiecutter.project_slug}}/package.json
+++ b/{{cookiecutter.project_slug}}/package.json
@@ -9,7 +9,7 @@
"babel-loader": "^9.1.2",
"bootstrap": "^5.2.3",
"browser-sync": "^3.0.2",
- "css-loader": "^6.5.1",
+ "css-loader": "^7.1.2",
"gulp-concat": "^2.6.1",
"concurrently": "^8.0.1",
"cssnano": "^7.0.0",
@@ -27,15 +27,15 @@
"postcss-loader": "^8.0.0",
"postcss-preset-env": "^9.0.0",
"sass": "^1.43.4",
- "sass-loader": "^14.0.0",
+ "sass-loader": "^16.0.1",
"webpack": "^5.65.0",
"webpack-bundle-tracker": "^3.0.1",
"webpack-cli": "^5.0.1",
"webpack-dev-server": "^5.0.2",
- "webpack-merge": "^5.8.0"
+ "webpack-merge": "^6.0.1"
},
"engines": {
- "node": "20"
+ "node": "22"
},
"browserslist": [
"last 2 versions"
diff --git a/{{cookiecutter.project_slug}}/pyproject.toml b/{{cookiecutter.project_slug}}/pyproject.toml
index 4ee354865..7d8256934 100644
--- a/{{cookiecutter.project_slug}}/pyproject.toml
+++ b/{{cookiecutter.project_slug}}/pyproject.toml
@@ -59,31 +59,11 @@ indent_size = 2
indent_size = 2
[tool.ruff]
+target-version = "py312"
# Exclude a variety of commonly ignored directories.
-exclude = [
- ".bzr",
- ".direnv",
- ".eggs",
- ".git",
- ".git-rewrite",
- ".hg",
- ".mypy_cache",
- ".nox",
- ".pants.d",
- ".pytype",
- ".ruff_cache",
- ".svn",
- ".tox",
- ".venv",
- "__pypackages__",
- "_build",
- "buck-out",
- "build",
- "dist",
- "node_modules",
- "venv",
+extend-exclude = [
"*/migrations/*.py",
- "staticfiles/*"
+ "staticfiles/*",
]
# Same as Django: https://github.com/cookiecutter/cookiecutter-django/issues/4792.
line-length = 88
@@ -145,33 +125,22 @@ select = [
"PERF",
# "FURB",
# "LOG",
- "RUF"
+ "RUF",
]
ignore = [
"S101", # Use of assert detected https://docs.astral.sh/ruff/rules/assert/
"RUF012", # Mutable class attributes should be annotated with `typing.ClassVar`
"SIM102", # sometimes it's better to nest
- "UP038" # Checks for uses of isinstance/issubclass that take a tuple
+ "UP038", # Checks for uses of isinstance/issubclass that take a tuple
# of types for comparison.
# Deactivated because it can make the code slow:
# https://github.com/astral-sh/ruff/issues/7871
]
-# Allow fix for all enabled rules (when `--fix`) is provided.
-fixable = ["ALL"]
-unfixable = []
# The fixes in extend-unsafe-fixes will require
# provide the `--unsafe-fixes` flag when fixing.
extend-unsafe-fixes = [
- "UP038"
+ "UP038",
]
-# Allow unused variables when underscore-prefixed.
-dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
-
-[tool.ruff.format]
-quote-style = "double"
-indent-style = "space"
-skip-magic-trailing-comma = false
-line-ending = "auto"
[tool.ruff.lint.isort]
force-single-line = true
diff --git a/{{cookiecutter.project_slug}}/requirements/base.txt b/{{cookiecutter.project_slug}}/requirements/base.txt
index 924a39119..f4bec317e 100644
--- a/{{cookiecutter.project_slug}}/requirements/base.txt
+++ b/{{cookiecutter.project_slug}}/requirements/base.txt
@@ -17,7 +17,7 @@ hiredis==3.0.0 # https://github.com/redis/hiredis-py
{%- endif %}
{%- if cookiecutter.use_celery == "y" %}
celery==5.4.0 # pyup: < 6.0 # https://github.com/celery/celery
-django-celery-beat==2.6.0 # https://github.com/celery/django-celery-beat
+django-celery-beat==2.7.0 # https://github.com/celery/django-celery-beat
{%- if cookiecutter.use_docker == 'y' %}
flower==2.0.1 # https://github.com/mher/flower
{%- endif %}
@@ -29,10 +29,10 @@ uvicorn-worker==0.2.0 # https://github.com/Kludex/uvicorn-worker
# Django
# ------------------------------------------------------------------------------
-django==5.0.8 # pyup: < 5.1 # https://www.djangoproject.com/
+django==5.0.9 # pyup: < 5.1 # https://www.djangoproject.com/
django-environ==0.11.2 # https://github.com/joke2k/django-environ
-django-model-utils==4.5.1 # https://github.com/jazzband/django-model-utils
-django-allauth[mfa]==64.0.0 # https://github.com/pennersr/django-allauth
+django-model-utils==5.0.0 # https://github.com/jazzband/django-model-utils
+django-allauth[mfa]==64.2.0 # https://github.com/pennersr/django-allauth
django-crispy-forms==2.3 # https://github.com/django-crispy-forms/django-crispy-forms
crispy-bootstrap5==2024.2 # https://github.com/django-crispy-forms/crispy-bootstrap5
{%- if cookiecutter.frontend_pipeline == 'Django Compressor' %}
@@ -47,7 +47,7 @@ django-cors-headers==4.4.0 # https://github.com/adamchainz/django-cors-headers
drf-spectacular==0.27.2 # https://github.com/tfranzel/drf-spectacular
{%- endif %}
{%- if cookiecutter.frontend_pipeline == 'Webpack' %}
-django-webpack-loader==3.1.0 # https://github.com/django-webpack/django-webpack-loader
+django-webpack-loader==3.1.1 # https://github.com/django-webpack/django-webpack-loader
{%- endif %}
# Project
diff --git a/{{cookiecutter.project_slug}}/requirements/local.txt b/{{cookiecutter.project_slug}}/requirements/local.txt
index a436348f6..28032149b 100644
--- a/{{cookiecutter.project_slug}}/requirements/local.txt
+++ b/{{cookiecutter.project_slug}}/requirements/local.txt
@@ -1,6 +1,7 @@
-r production.txt
-Werkzeug[watchdog]==3.0.3 # https://github.com/pallets/werkzeug
+watchdog==4.0.2 # https://github.com/gorakhargosh/watchdog
+Werkzeug[watchdog]==3.0.4 # https://github.com/pallets/werkzeug
ipdb==0.13.13 # https://github.com/gotcha/ipdb
{%- if cookiecutter.use_docker == 'y' %}
psycopg[c]==3.2.1 # https://github.com/psycopg/psycopg
@@ -8,12 +9,12 @@ psycopg[c]==3.2.1 # https://github.com/psycopg/psycopg
psycopg[binary]==3.2.1 # https://github.com/psycopg/psycopg
{%- endif %}
{%- if cookiecutter.use_async == 'y' or cookiecutter.use_celery == 'y' %}
-watchfiles==0.21.0 # https://github.com/samuelcolvin/watchfiles
+watchfiles==0.24.0 # https://github.com/samuelcolvin/watchfiles
{%- endif %}
# Testing
# ------------------------------------------------------------------------------
-mypy==1.11.1 # https://github.com/python/mypy
+mypy==1.11.2 # https://github.com/python/mypy
django-stubs[compatible-mypy]==5.0.4 # https://github.com/typeddjango/django-stubs
pytest==8.3.2 # https://github.com/pytest-dev/pytest
pytest-sugar==1.0.0 # https://github.com/Frozenball/pytest-sugar
@@ -24,21 +25,21 @@ djangorestframework-stubs==3.15.0 # https://github.com/typeddjango/djangorestfr
# Documentation
# ------------------------------------------------------------------------------
sphinx==7.4.7 # https://github.com/sphinx-doc/sphinx
-sphinx-autobuild==2024.4.16 # https://github.com/GaretJax/sphinx-autobuild
+sphinx-autobuild==2024.9.3 # https://github.com/GaretJax/sphinx-autobuild
sphinx-rtd-theme==2.0.0 # https://pypi.org/project/sphinx-rtd-theme/
# Code quality
# ------------------------------------------------------------------------------
-ruff==0.5.7 # https://github.com/astral-sh/ruff
+ruff==0.6.3 # https://github.com/astral-sh/ruff
coverage==7.6.1 # https://github.com/nedbat/coveragepy
-djlint==1.34.1 # https://github.com/Riverside-Healthcare/djLint
+djlint==1.35.2 # https://github.com/Riverside-Healthcare/djLint
pre-commit==3.8.0 # https://github.com/pre-commit/pre-commit
# Django
# ------------------------------------------------------------------------------
-factory-boy==3.3.0 # https://github.com/FactoryBoy/factory_boy
+factory-boy==3.3.1 # https://github.com/FactoryBoy/factory_boy
django-debug-toolbar==4.4.6 # https://github.com/jazzband/django-debug-toolbar
django-extensions==3.2.3 # https://github.com/django-extensions/django-extensions
django-coverage-plugin==3.1.0 # https://github.com/nedbat/django_coverage_plugin
-pytest-django==4.8.0 # https://github.com/pytest-dev/pytest-django
+pytest-django==4.9.0 # https://github.com/pytest-dev/pytest-django
diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/conftest.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/conftest.py
index 98efcd75e..8d3af053b 100644
--- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/conftest.py
+++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/conftest.py
@@ -9,6 +9,6 @@ def _media_storage(settings, tmpdir) -> None:
settings.MEDIA_ROOT = tmpdir.strpath
-@pytest.fixture()
+@pytest.fixture
def user(db) -> User:
return UserFactory()
diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/layouts/entrance.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/layouts/entrance.html
index 91cbaba3f..96ba42499 100644
--- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/layouts/entrance.html
+++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/layouts/entrance.html
@@ -24,6 +24,8 @@
{% endif %}
{% block content %}
{% endblock content %}
+ {% block extra_body %}
+ {% endblock extra_body %}
{% endblock body %}{% endraw %}
diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/factories.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/factories.py
index 785d80001..3b3d39d29 100644
--- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/factories.py
+++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/factories.py
@@ -7,7 +7,7 @@ from factory import post_generation
from factory.django import DjangoModelFactory
-class UserFactory(DjangoModelFactory):
+class UserFactory(DjangoModelFactory[User]):
{%- if cookiecutter.username_type == "username" %}
username = Faker("user_name")
{%- endif %}
diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_admin.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_admin.py
index bd1a852b7..4482d5207 100644
--- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_admin.py
+++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_admin.py
@@ -46,7 +46,7 @@ class TestUserAdmin:
response = admin_client.get(url)
assert response.status_code == HTTPStatus.OK
- @pytest.fixture()
+ @pytest.fixture
def _force_allauth(self, settings):
settings.DJANGO_ADMIN_FORCE_ALLAUTH = True
# Reload the admin module to apply the setting change
@@ -55,7 +55,7 @@ class TestUserAdmin:
with contextlib.suppress(admin.sites.AlreadyRegistered): # type: ignore[attr-defined]
reload(users_admin)
- @pytest.mark.django_db()
+ @pytest.mark.django_db
@pytest.mark.usefixtures("_force_allauth")
def test_allauth_login(self, rf, settings):
request = rf.get("/fake-url")
diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_drf_views.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_drf_views.py
index cc491f8a1..2b57f058c 100644
--- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_drf_views.py
+++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_drf_views.py
@@ -6,7 +6,7 @@ from {{ cookiecutter.project_slug }}.users.models import User
class TestUserViewSet:
- @pytest.fixture()
+ @pytest.fixture
def api_rf(self) -> APIRequestFactory:
return APIRequestFactory()
diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_managers.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_managers.py
index 963ac758c..89caf6ca8 100644
--- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_managers.py
+++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_managers.py
@@ -6,7 +6,7 @@ from django.core.management import call_command
from {{ cookiecutter.project_slug }}.users.models import User
-@pytest.mark.django_db()
+@pytest.mark.django_db
class TestUserManager:
def test_create_user(self):
user = User.objects.create_user(
@@ -43,7 +43,7 @@ class TestUserManager:
assert user.username is None
-@pytest.mark.django_db()
+@pytest.mark.django_db
def test_createsuperuser_command():
"""Ensure createsuperuser command works with our custom manager."""
out = StringIO()
diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_swagger.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_swagger.py
index 3081d1f65..5db371dbe 100644
--- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_swagger.py
+++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_swagger.py
@@ -10,7 +10,7 @@ def test_swagger_accessible_by_admin(admin_client):
assert response.status_code == HTTPStatus.OK
-@pytest.mark.django_db()
+@pytest.mark.django_db
def test_swagger_ui_not_accessible_by_normal_user(client):
url = reverse("api-docs")
response = client.get(url)
|