
Using tox to Test a Django App Across Multiple Django Versions
Recently, I developed a reusable Django app django-clearplaintext for normalizing plain text in Django templates. And to package and test it properly, I had a fresh look to Tox. Tox is the standard testing tool that creates isolated virtual environments, installs the exact dependencies you specify, and runs your test suite in each one — all from a single command. This post walks through a complete, working setup using a minimal example app called django-shorturl . The Example App: django-shorturl django-shorturl is a self-contained Django app with one model and one view. shorturl/models.py from django.db import models from django.utils.translation import gettext_lazy as _ class ShortLink ( models . Model ): slug = models . SlugField ( _ ( " slug " ), unique = True ) target_url = models . URLField ( _ ( " target URL " )) created_at = models . DateTimeField ( _ ( " created at " ), auto_now_add = True ) class Meta : verbose_name = _ ( " short link " ) verbose_name_plural = _ ( " short lin
Continue reading on Dev.to Python
Opens in a new tab




