mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #26919 -- Added the action form's media in the changelist view.
This commit is contained in:
committed by
Tim Graham
parent
b785927b44
commit
b387189d86
@@ -43,6 +43,7 @@ from django.utils.six.moves.urllib.parse import parse_qsl, urljoin, urlparse
|
||||
|
||||
from . import customadmin
|
||||
from .admin import CityAdmin, site, site2
|
||||
from .forms import MediaActionForm
|
||||
from .models import (
|
||||
Actor, AdminOrderedAdminMethod, AdminOrderedCallable, AdminOrderedField,
|
||||
AdminOrderedModelMethod, Answer, Article, BarAccount, Book, Bookmark,
|
||||
@@ -3374,6 +3375,17 @@ action)</option>
|
||||
self.assertEqual(len(mail.outbox), 1)
|
||||
self.assertEqual(mail.outbox[0].subject, 'Greetings from a function action')
|
||||
|
||||
def test_media_from_actions_form(self):
|
||||
"""
|
||||
The action form's media is included in changelist view's media.
|
||||
"""
|
||||
response = self.client.get(reverse('admin:admin_views_subscriber_changelist'))
|
||||
media_path = MediaActionForm.Media.js[0]
|
||||
self.assertIsInstance(response.context['action_form'], MediaActionForm)
|
||||
self.assertIn('media', response.context)
|
||||
self.assertIn(media_path, response.context['media']._js)
|
||||
self.assertContains(response, media_path)
|
||||
|
||||
def test_user_message_on_none_selected(self):
|
||||
"""
|
||||
User should see a warning when 'Go' is pressed and no items are selected.
|
||||
|
||||
Reference in New Issue
Block a user