About Tagging Tests

You can tag a test and execute only tagged tests using the following:

Test case:

1
2
3
4
5
6
from django.test import TestCase, tag

class LoginTestCase(TestCase):
    @tag("frontend", "authentication")
    def test_login(self):
        # …

Bash command:

1
(env)$ python manage.py test --tag=frontend

Tips and Tricks Programming Testing Django 4.2 Django 3.2 Django 2.2