Skip to content

Commit

Permalink
Added AdminSiteSmokeTest.exclude_apps, which lets you skip certain apps.
Browse files Browse the repository at this point in the history
  • Loading branch information
PetrDlouhy authored and SeanHayes committed Jan 26, 2016
1 parent 50abc18 commit 53ecdfa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,7 @@ you can do following:
class AdminSiteSmokeTest(AdminSiteSmokeTestMixin, TestCase):
fixtures = ['data']
And you can exclude certain (external) apps with::

exclude_apps = ['constance',]
3 changes: 3 additions & 0 deletions django_admin_smoke_tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
def for_all_model_admins(fn):
def test_deco(self):
for model, model_admin in self.modeladmins:
if model._meta.app_label in self.exclude_apps:
continue
try:
fn(self, model, model_admin)
except Exception:
Expand All @@ -23,6 +25,7 @@ def test_deco(self):

class AdminSiteSmokeTestMixin(object):
modeladmins = None
exclude_apps = []
fixtures = ['django_admin_smoke_tests']

single_attributes = ['date_hierarchy']
Expand Down

0 comments on commit 53ecdfa

Please sign in to comment.