Test cases

All new code should include corresponding tests.
Suggest using pytest (maybe even pytest-django) to write tests and with pytest-cov to generate test coverage reports.