django-admin-smoke-tests-2

Runs some quick tests on your admin site objects to make sure there aren't non-existant fields listed, etc.


Keywords
django, admin, smoke, test
License
BSD-3-Clause
Install
pip install django-admin-smoke-tests-2==0.3.1

Documentation

django-admin-smoke-tests

https://travis-ci.org/greyside/django-admin-smoke-tests.svg?branch=master https://coveralls.io/repos/greyside/django-admin-smoke-tests/badge.png?branch=master

Run with ./manage.py test django_admin_smoke_tests.tests.

You don't have to add anything INSTALLED_APPS

Usage in your tests

Import into your own code:

from django.test import TestCase
from django_admin_smoke_tests.tests import AdminSiteSmokeTestMixin

class AdminSiteSmokeTest(AdminSiteSmokeTestMixin, TestCase):
    def setUp(self):
        super(AdminSiteSmokeTest, self).setUp()
        # custom setup goes here

If you want to use admin smoke tests as part of your tests with data from fixtures, you can do following:

from django.test import TestCase
from django_admin_smoke_tests.tests import AdminSiteSmokeTestMixin

class AdminSiteSmokeTest(AdminSiteSmokeTestMixin, TestCase):
    fixtures = ['data']

And you can exclude certain (external) apps or model admins with:

exclude_apps = ['constance',]
exclude_modeladmins = [apps.admin.ModelAdmin]