Running the Tests¶
Python¶
Start by checking out the source code of the project and switching to the development branch:
$ git clone git@github.com:ephes/django-cast.git
$ cd django-cast
$ git checkout develop
Then, create a virtualenv and install the project dependencies:
$ uv venv
$ uv pip install -e .[dev]
Now create the test database:
$ uv run manage.py migrate
The tests are then run by executing the following command:
$ uv run pytest
You can measure the test coverage by running the following command:
$ uv run coverage run -m pytest && uv run coverage html && open htmlcov/index.html
In order to make running tests faster, the test database is set up to be reused and migrations are not applied. This implies that if you have added a new Django migration to your codebase, you will need to execute the following commands below to re-create the test database:
$ rm tests/test_database.sqlite3 # delete the old test database
$ uv run manage.py migrate # re-create the test database
After that, you should be able to run the tests again.
Javascript¶
$ cd javascript
$ npx vitest run