mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #10640 - Adds a add_form_template option to ModelAdmin. Thanks jcsackett.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12216 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -550,11 +550,11 @@ class AdminViewPermissionsTest(TestCase):
|
||||
self.assert_("var hello = 'Hello!';" in request.content)
|
||||
self.assertTemplateUsed(request, 'custom_admin/change_list.html')
|
||||
|
||||
# Test custom change form template
|
||||
# Test custom add form template
|
||||
request = self.client.get('/test_admin/admin/admin_views/customarticle/add/')
|
||||
self.assertTemplateUsed(request, 'custom_admin/change_form.html')
|
||||
self.assertTemplateUsed(request, 'custom_admin/add_form.html')
|
||||
|
||||
# Add an article so we can test delete and history views
|
||||
# Add an article so we can test delete, change, and history views
|
||||
post = self.client.post('/test_admin/admin/admin_views/customarticle/add/', {
|
||||
'content': '<p>great article</p>',
|
||||
'date_0': '2008-03-18',
|
||||
@@ -563,7 +563,10 @@ class AdminViewPermissionsTest(TestCase):
|
||||
self.assertRedirects(post, '/test_admin/admin/admin_views/customarticle/')
|
||||
self.failUnlessEqual(CustomArticle.objects.all().count(), 1)
|
||||
|
||||
# Test custom delete and object history templates
|
||||
# Test custom delete, change, and object history templates
|
||||
# Test custom change form template
|
||||
request = self.client.get('/test_admin/admin/admin_views/customarticle/1/')
|
||||
self.assertTemplateUsed(request, 'custom_admin/change_form.html')
|
||||
request = self.client.get('/test_admin/admin/admin_views/customarticle/1/delete/')
|
||||
self.assertTemplateUsed(request, 'custom_admin/delete_confirmation.html')
|
||||
request = self.client.get('/test_admin/admin/admin_views/customarticle/1/history/')
|
||||
|
||||
Reference in New Issue
Block a user