1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Removed support for admin validators per deprecation timeline; refs #16905.

This commit is contained in:
Tim Graham
2015-01-18 14:43:21 -05:00
parent 5fb582d952
commit 67a76500a5
8 changed files with 4 additions and 927 deletions

View File

@@ -7,16 +7,13 @@ from django.contrib.admin.options import (ModelAdmin, TabularInline,
HORIZONTAL, VERTICAL)
from django.contrib.admin.sites import AdminSite
from django.contrib.admin.widgets import AdminDateWidget, AdminRadioSelect
from django.contrib.admin.validation import ModelAdminValidator
from django.contrib.admin import (SimpleListFilter,
BooleanFieldListFilter)
from django.core.checks import Error
from django.core.exceptions import ImproperlyConfigured
from django.forms.models import BaseModelFormSet
from django.forms.widgets import Select
from django.test import TestCase, ignore_warnings
from django.test import TestCase
from django.utils import six
from django.utils.deprecation import RemovedInDjango19Warning
from .models import Band, Concert, ValidationTestModel, ValidationTestInlineModel
@@ -1503,21 +1500,6 @@ class FormsetCheckTests(CheckTestCase):
self.assertIsValid(ValidationTestModelAdmin, ValidationTestModel)
class CustomModelAdminTests(CheckTestCase):
@ignore_warnings(category=RemovedInDjango19Warning)
def test_deprecation(self):
"Deprecated Custom Validator definitions still work with the check framework."
class CustomValidator(ModelAdminValidator):
def validate_me(self, model_admin, model):
raise ImproperlyConfigured('error!')
class CustomModelAdmin(ModelAdmin):
validator_class = CustomValidator
self.assertIsInvalid(CustomModelAdmin, ValidationTestModel, 'error!')
class ListDisplayEditableTests(CheckTestCase):
def test_list_display_links_is_none(self):
"""