diff options
| author | Karen Tracey <kmtracey@gmail.com> | 2010-03-08 20:36:37 +0000 |
|---|---|---|
| committer | Karen Tracey <kmtracey@gmail.com> | 2010-03-08 20:36:37 +0000 |
| commit | 021ba30ad1d4fffada4f2d43d47a4704bcfca45e (patch) | |
| tree | 24f5b58ec3e06defccc1de000f2e313a7bc700aa /tests/regressiontests/admin_validation/tests.py | |
| parent | f2bc4dd0a9e4676f77d4a1c0ddb5e836750f966c (diff) | |
Fixed #12481: Updated admin validation code to not reject non-editable fields in readonly_fields, since these are handled fine by the display code itself. Thanks lashni and Alex.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12730 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/admin_validation/tests.py')
| -rw-r--r-- | tests/regressiontests/admin_validation/tests.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/regressiontests/admin_validation/tests.py b/tests/regressiontests/admin_validation/tests.py new file mode 100644 index 0000000000..9166360ae3 --- /dev/null +++ b/tests/regressiontests/admin_validation/tests.py @@ -0,0 +1,18 @@ +from django.contrib import admin +from django.contrib.admin.validation import validate +from django.test import TestCase + +from models import Song + + +class ValidationTestCase(TestCase): + def test_readonly_and_editable(self): + class SongAdmin(admin.ModelAdmin): + readonly_fields = ["original_release"] + fieldsets = [ + (None, { + "fields": ["title", "original_release"], + }), + ] + + validate(SongAdmin, Song) |
