From 24462dfc55623393c2200b7f5310eb91e3fc1436 Mon Sep 17 00:00:00 2001 From: James Gilmore Date: Wed, 28 Feb 2024 17:45:40 +0000 Subject: [PATCH] Improve documentation slightly for new developers The documentation was really easy to follow, but noticed that these comamnds for setting up the test app was already defined in the Makefile, so just repointed the development documentation to use the Make command instead. --- Makefile | 8 ++++++-- docs/development.md | 21 ++++++--------------- 2 files changed, 12 insertions(+), 17 deletions(-) diff --git a/Makefile b/Makefile index cdd5178c..ff2447e6 100644 --- a/Makefile +++ b/Makefile @@ -34,10 +34,14 @@ test: check-venv ## Run the test suite @printf "$(CYAN)Running test suite$(COFF)\n" $(environment) pytest +reset_app: check-venv ## Reset the DB for a fresh install. + @printf "$(CYAN)Resetting the local DB$(COFF)\n" + $(environment) python tests/test_app/manage.py reset + test_app: check-venv ## Run the test app @printf "$(CYAN)Running test app$(COFF)\n" - $(environment) python tests/test_app/manage.py migrate - $(environment) python tests/test_app/manage.py runserver_plus + $(environment) python tests/test_app/manage.py migrate # Setup db tables etc. + $(environment) python tests/test_app/manage.py runserver_plus # Run development server (with werkzeug debugger). test_user: ## Make the test user $(environment) python tests/test_app/manage.py shell -c "from django.contrib.auth.models import User; User.objects.create_superuser('test@test.com', password='test')" diff --git a/docs/development.md b/docs/development.md index bdaa979a..e8fb480c 100644 --- a/docs/development.md +++ b/docs/development.md @@ -6,24 +6,15 @@ This project manages dependencies using [poetry](https://python-poetry.org/) Ensure you have poetry installed (`pip install poetry`) -Then get setup with `poetry install` +Then get setup with `poetry install` you will need to fork the repo and then clone. - git clone git@github.com:farridav/django-jazzmin.git + git clone git@github.com:{github_username}/django-jazzmin.git poetry install -## Running the test project - -Setup db tables etc. - - python tests/test_app/manage.py migrate - -Generate test data - - python tests/test_app/manage.py reset - -Run development server (with werkzeug debugger) - - python tests/test_app/manage.py runserver_plus +## Running the test project (See the [Makefile](../Makefile) for more details) + + make reset_app + make test_app ## Running the tests