mirror of
https://github.com/django/django.git
synced 2024-11-19 16:04:13 +00:00
021ba30ad1
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12730 bcc190cf-cafb-0310-a4f2-bffc1f526a37
19 lines
507 B
Python
19 lines
507 B
Python
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)
|