Ticket #10799: list_editable_and_parent_link.diff
File list_editable_and_parent_link.diff, 2.3 KB (added by , 16 years ago) |
---|
-
tests/regressiontests/admin_views/tests.py
13 13 from django.utils.html import escape 14 14 15 15 # local test models 16 from models import Article, CustomArticle, Section, ModelWithStringPrimaryKey, Person, Persona, FooAccount, BarAccount, Subscriber, ExternalSubscriber, Podcast, EmptyModel16 from models import Article, CustomArticle, Section, ModelWithStringPrimaryKey, Person, Persona, FooAccount, BarAccount, Subscriber, ExternalSubscriber, Vodcast, Podcast, EmptyModel 17 17 18 18 try: 19 19 set … … 796 796 response = self.client.get('/test_admin/admin/admin_views/podcast/') 797 797 self.failUnlessEqual(response.status_code, 200) 798 798 799 def test_inheritance_2(self): 800 Vodcast.objects.create(name="This Week in Django", released=True) 801 response = self.client.get('/test_admin/admin/admin_views/vodcast/') 802 self.failUnlessEqual(response.status_code, 200) 803 799 804 def test_changelist_input_html(self): 800 805 response = self.client.get('/test_admin/admin/admin_views/person/') 801 806 # 2 inputs per object(the field and the hidden id field) = 6 -
tests/regressiontests/admin_views/models.py
266 266 267 267 ordering = ('name',) 268 268 269 class Vodcast(Media): 270 media = models.OneToOneField(Media, primary_key=True, parent_link=True) 271 released = models.BooleanField(default=False) 272 273 class VodcastAdmin(admin.ModelAdmin): 274 list_display = ('name', 'released') 275 list_editable = ('released',) 276 277 ordering = ('name',) 278 269 279 class Parent(models.Model): 270 280 name = models.CharField(max_length=128) 271 281 … … 303 313 admin.site.register(ExternalSubscriber, ExternalSubscriberAdmin) 304 314 admin.site.register(OldSubscriber, OldSubscriberAdmin) 305 315 admin.site.register(Podcast, PodcastAdmin) 316 admin.site.register(Vodcast, VodcastAdmin) 306 317 admin.site.register(Parent, ParentAdmin) 307 318 admin.site.register(EmptyModel, EmptyModelAdmin) 308 319 admin.site.register(Fabric, FabricAdmin)