diff --git a/django/contrib/admin/templates/admin/delete_selected_confirmation.html b/django/contrib/admin/templates/admin/delete_selected_confirmation.html
index 2bb4fb4..127519b 100644
a
|
b
|
|
1 | 1 | {% extends "admin/base_site.html" %} |
2 | | {% load i18n %} |
| 2 | {% load i18n l10n %} |
3 | 3 | |
4 | 4 | {% block breadcrumbs %} |
5 | 5 | <div class="breadcrumbs"> |
… |
… |
|
36 | 36 | <form action="" method="post">{% csrf_token %} |
37 | 37 | <div> |
38 | 38 | {% for obj in queryset %} |
39 | | <input type="hidden" name="{{ action_checkbox_name }}" value="{{ obj.pk }}" /> |
| 39 | <input type="hidden" name="{{ action_checkbox_name }}" value="{{ obj.pk|unlocalize }}" /> |
40 | 40 | {% endfor %} |
41 | 41 | <input type="hidden" name="action" value="delete_selected" /> |
42 | 42 | <input type="hidden" name="post" value="yes" /> |
diff --git a/tests/regressiontests/admin_views/tests.py b/tests/regressiontests/admin_views/tests.py
index 21c5eb3..db5434e 100644
a
|
b
|
class AdminActionsTest(TestCase):
|
1674 | 1674 | self.assertTrue(confirmation.content.count(ACTION_CHECKBOX_NAME) == 2) |
1675 | 1675 | response = self.client.post('/test_admin/admin/admin_views/subscriber/', delete_confirmation_data) |
1676 | 1676 | self.assertEqual(Subscriber.objects.count(), 0) |
1677 | | |
| 1677 | |
| 1678 | def test_ticket_14895(self): |
| 1679 | """ Regression test for #14895. If USE_THOUSAND_SEPARATOR is set, make sure that the ids for |
| 1680 | the objects selected for deletion are rendered without separators. |
| 1681 | """ |
| 1682 | self.old_USE_THOUSAND_SEPARATOR = settings.USE_THOUSAND_SEPARATOR |
| 1683 | self.old_USE_L10N = settings.USE_L10N |
| 1684 | settings.USE_THOUSAND_SEPARATOR = True |
| 1685 | settings.USE_L10N = True |
| 1686 | subscriber = Subscriber.objects.get(id=1) |
| 1687 | subscriber.id = 9999 |
| 1688 | subscriber.save() |
| 1689 | action_data = { |
| 1690 | ACTION_CHECKBOX_NAME: [9999, 2], |
| 1691 | 'action' : 'delete_selected', |
| 1692 | 'index': 0, |
| 1693 | } |
| 1694 | response = self.client.post('/test_admin/admin/admin_views/subscriber/', action_data) |
| 1695 | self.assertTemplateUsed(response, 'admin/delete_selected_confirmation.html') |
| 1696 | self.assertTrue('value="9999"' in response.content and 'value="2"' in response.content) # Instead of 9,999 |
| 1697 | settings.USE_THOUSAND_SEPARATOR = self.old_USE_THOUSAND_SEPARATOR |
| 1698 | settings.USE_L10N = self.old_USE_L10N |
| 1699 | |
1678 | 1700 | def test_model_admin_default_delete_action_protected(self): |
1679 | 1701 | """ |
1680 | 1702 | Tests the default delete action defined as a ModelAdmin method in the |