summaryrefslogtreecommitdiff
path: root/tests/admin_checks/tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/admin_checks/tests.py')
-rw-r--r--tests/admin_checks/tests.py23
1 files changed, 14 insertions, 9 deletions
diff --git a/tests/admin_checks/tests.py b/tests/admin_checks/tests.py
index 0f6320430e..934e3f391e 100644
--- a/tests/admin_checks/tests.py
+++ b/tests/admin_checks/tests.py
@@ -1,5 +1,7 @@
from __future__ import unicode_literals
+import warnings
+
from django import forms
from django.contrib import admin
from django.core import checks
@@ -425,12 +427,15 @@ class SystemChecksTestCase(TestCase):
class MyModelAdmin(admin.ModelAdmin):
validator_class = MyValidator
- errors = MyModelAdmin.check(model=Song)
- expected = [
- checks.Error(
- 'error!',
- hint=None,
- obj=MyModelAdmin,
- )
- ]
- self.assertEqual(errors, expected)
+ with warnings.catch_warnings(record=True):
+ warnings.filterwarnings('ignore', module='django.contrib.admin.options')
+ errors = MyModelAdmin.check(model=Song)
+
+ expected = [
+ checks.Error(
+ 'error!',
+ hint=None,
+ obj=MyModelAdmin,
+ )
+ ]
+ self.assertEqual(errors, expected)