Ticket #5373: 5373_regressiontests_admin_inlines.diff
File 5373_regressiontests_admin_inlines.diff, 1.9 KB (added by , 14 years ago) |
---|
-
tests/regressiontests/admin_inlines/tests.py
1 1 from django.test import TestCase 2 2 3 3 # local test models 4 from models import Book, Author, BookInline 4 5 from models import Holder, Inner, InnerInline 5 6 from models import Holder2, Inner2, Holder3, Inner3 6 7 from models import Person, OutfitItem, Fashionista … … 38 39 % holder.id) 39 40 self.assertContains(response, '<label>Inner readonly label:</label>') 40 41 42 def test_fk_verbose_name(self): 43 """ Bug 5373: checking the fk verbose name """ 44 book = Book.objects.create(name='mybio') 45 response = self.client.get('/test_admin/admin/admin_inlines/author/add/') 46 self.assertContains(response, 'Novel') 47 41 48 def test_many_to_many_inlines(self): 42 49 "Autogenerated many-to-many inlines are displayed correctly (#13407)" 43 50 response = self.client.get('/test_admin/admin/admin_inlines/author/add/') -
tests/regressiontests/admin_inlines/models.py
6 6 from django.contrib import admin 7 7 from django.contrib.contenttypes.models import ContentType 8 8 from django.contrib.contenttypes import generic 9 from django.utils.translation import ugettext_lazy as _ 9 10 10 11 class Parent(models.Model): 11 12 name = models.CharField(max_length=50) … … 32 33 33 34 class Book(models.Model): 34 35 name = models.CharField(max_length=50) 36 37 class Meta: 38 verbose_name = _(u'Novel') 39 verbose_name_plural = _(u'Novels') 35 40 36 41 class Author(models.Model): 37 42 name = models.CharField(max_length=50)