Merge branch 'migrate-post-gen-hook-pathlib' into lint-format-template-with-ruff

This commit is contained in:
Bruno Alla 2025-01-20 13:43:07 +00:00
commit 9902f4d76c
7 changed files with 13 additions and 6 deletions

View File

@ -3,6 +3,15 @@ All enhancements and patches to Cookiecutter Django will be documented in this f
<!-- GENERATOR_PLACEHOLDER -->
## 2025.01.16
### Updated
- Update ruff to 0.9.2 ([#5646](https://github.com/cookiecutter/cookiecutter-django/pull/5646))
- Bump amazon/aws-cli from 2.22.1 to 2.23.0 ([#5645](https://github.com/cookiecutter/cookiecutter-django/pull/5645))
## 2025.01.15

View File

@ -397,9 +397,7 @@ def remove_aws_dockerfile():
def remove_drf_starter_files():
Path("config", "api_router.py").unlink()
shutil.rmtree(Path("{{cookiecutter.project_slug}}", "users", "api"))
Path("{{cookiecutter.project_slug}}", "users", "tests", "test_drf_urls.py").unlink()
Path("{{cookiecutter.project_slug}}", "users", "tests", "test_drf_views.py").unlink()
Path("{{cookiecutter.project_slug}}", "users", "tests", "test_swagger.py").unlink()
shutil.rmtree(Path("{{cookiecutter.project_slug}}", "users", "tests", "api"))
def main(): # noqa: C901, PLR0912, PLR0915

View File

@ -1,6 +1,6 @@
[project]
name = "cookiecutter-django"
version = "2025.01.15"
version = "2025.01.16"
description = "A Cookiecutter template for creating production-ready Django projects quickly."
readme = "README.md"
keywords = [

View File

@ -4,14 +4,14 @@ import pytest
from django.urls import reverse
def test_swagger_accessible_by_admin(admin_client):
def test_api_docs_accessible_by_admin(admin_client):
url = reverse("api-docs")
response = admin_client.get(url)
assert response.status_code == HTTPStatus.OK
@pytest.mark.django_db
def test_swagger_ui_not_accessible_by_normal_user(client):
def test_api_docs_not_accessible_by_anonymous_users(client):
url = reverse("api-docs")
response = client.get(url)
assert response.status_code == HTTPStatus.FORBIDDEN