mirror of
https://github.com/django/django.git
synced 2025-10-26 07:06:08 +00:00
Fixed #13407 -- Corrected verbose names for autogenerated m2m models, and cleaned up the default form prefix when an autogenerated m2m through model is used in a formset. Thanks to carljm for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13029 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -38,6 +38,16 @@ class TestInline(TestCase):
|
||||
% holder.id)
|
||||
self.assertContains(response, '<label>Inner readonly label:</label>')
|
||||
|
||||
def test_many_to_many_inlines(self):
|
||||
"Autogenerated many-to-many inlines are displayed correctly (#13407)"
|
||||
response = self.client.get('/test_admin/admin/admin_inlines/author/add/')
|
||||
# The heading for the m2m inline block uses the right text
|
||||
self.assertContains(response, '<h2>Author-book relationships</h2>')
|
||||
# The "add another" label is correct
|
||||
self.assertContains(response, 'Add another Author-Book Relationship')
|
||||
# The '+' is dropped from the autogenerated form prefix (Author_books+)
|
||||
self.assertContains(response, 'id="id_Author_books-TOTAL_FORMS"')
|
||||
|
||||
|
||||
class TestInlineMedia(TestCase):
|
||||
fixtures = ['admin-views-users.xml']
|
||||
|
||||
Reference in New Issue
Block a user