1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #15964 - Do not order admin actions by description

Thanks to julien for the report and patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16162 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Luke Plant
2011-05-05 22:03:17 +00:00
parent d11acfd209
commit 8eccb728cc
3 changed files with 18 additions and 4 deletions

View File

@@ -1971,6 +1971,20 @@ class AdminActionsTest(TestCase):
response = self.client.post(url, action_data)
self.assertRedirects(response, url)
def test_actions_ordering(self):
"""
Ensure that actions are ordered as expected.
Refs #15964.
"""
response = self.client.get('/test_admin/admin/admin_views/externalsubscriber/')
self.assertTrue('''<label>Action: <select name="action">
<option value="" selected="selected">---------</option>
<option value="delete_selected">Delete selected external subscribers</option>
<option value="redirect_to">Redirect to (Awesome action)</option>
<option value="external_mail">External mail (Another awesome action)</option>
</select>'''in response.content,
)
def test_model_without_action(self):
"Tests a ModelAdmin without any action"
response = self.client.get('/test_admin/admin/admin_views/oldsubscriber/')