-
Notifications
You must be signed in to change notification settings - Fork 0
Testing
Benjamin West edited this page Mar 18, 2023
·
10 revisions
Pretty simplistic, there is a
testing
folder within the vets
django application which houses the tests.
I wrote VetsTestRunner
which loads test data once at the start of the run from VetsTestData
. This gives a bit
of data to get off the ground. This is explicitly defined in settings.py
as the test runner for this project.
export DJANGO_SECRET_KEY="<< some long string>>>"
export DJANGO_DATABASE="local"
export DJANGO_DEBUG="True"
Just a call to:
# Grab the deps
pip install -r application/requirements.txt
# Make the initial db migration file and apply it to local DB.
python application/manage.py makemigrations
python application/manage.py migrate
# Time the big elements of the run (db creation) and verbosity == 2
# Also you can keep the db for later if you wish (this is unreliable at best for me though!)
python application/manage.py test --timing -v 2 --keepdb
Make a superuser in the db and fire up the dev server:
python application/manage.py createsuperuser
python application/manage.py runserver
python application/manage.py dbshell
kubectl apply -f build-descriptors/vets