From c986b5ab0d7d7ffb4a9c12c488f61c27e76e4e7d Mon Sep 17 00:00:00 2001 From: Fedor Borshev Date: Wed, 26 Aug 2026 09:16:50 +0200 Subject: [PATCH] Point TEST_RUNNER at the module the runner actually lives in MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit TEST_RUNNER in boilerplate.py referenced app.test.disable_test_command_runner.DisableTestCommandRunner, but no app/test/ package exists — the class lives in app/testing/runner.py. In generated projects, ./manage.py test therefore crashed with an ImportError instead of raising the intended CommandError telling the user to run pytest via make test. Also update the README reference to the same long-gone app.test package: the DRF test client is app.testing.api, its fixtures are as_user and as_anon, and the example file is test_whoami.py. Co-Authored-By: Claude Fable 5 --- {{ cookiecutter.name }}/README.md | 2 +- {{ cookiecutter.name }}/src/app/conf/boilerplate.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/{{ cookiecutter.name }}/README.md b/{{ cookiecutter.name }}/README.md index 8924e317..4738c64c 100644 --- a/{{ cookiecutter.name }}/README.md +++ b/{{ cookiecutter.name }}/README.md @@ -7,7 +7,7 @@ This project is bootstrapped using [fandsdev/django](http://github.com/fandsdev/ The main django app is called `app`. It contains `.env` file for django-environ. For examples see `src/app/.env.ci`. Here are some usefull app-wide tools: * `app.admin` — app-wide django-admin customizations (empty yet), check out usage [examples](https://github.com/fandsdev/django/tree/master/%7B%7Bcookiecutter.name%7D%7D/src/app/admin) -* `app.test.api_client` (available as `api` and `anon` fixtures within pytest) — a [convinient DRF test client](https://github.com/fandsdev/django/blob/master/%7B%7Bcookiecutter.name%7D%7D/src/users/tests/tests_whoami.py#L6-L16). +* `app.testing.api` (available as `as_user` and `as_anon` fixtures within pytest) — a [convinient DRF test client](https://github.com/fandsdev/django/blob/master/%7B%7Bcookiecutter.name%7D%7D/src/users/tests/test_whoami.py#L7-L19). Django user model is located in the separate `users` app. diff --git a/{{ cookiecutter.name }}/src/app/conf/boilerplate.py b/{{ cookiecutter.name }}/src/app/conf/boilerplate.py index c4fed157..624582bf 100644 --- a/{{ cookiecutter.name }}/src/app/conf/boilerplate.py +++ b/{{ cookiecutter.name }}/src/app/conf/boilerplate.py @@ -9,6 +9,6 @@ ROOT_URLCONF = "app.urls" # Disable built-in ./manage.py test command in favor of pytest -TEST_RUNNER = "app.test.disable_test_command_runner.DisableTestCommandRunner" +TEST_RUNNER = "app.testing.runner.DisableTestCommandRunner" WSGI_APPLICATION = "app.wsgi.application"