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

Fixed #15938 -- Prevented the max_length number in the admin prepopulated_fields javascript to be localized when USE_THOUSAND_SEPARATOR is turned on. Thanks to Lev Maximov, Mathieu Agopian and feel.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@17033 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Julien Phalip
2011-10-26 05:33:17 +00:00
parent c1a014bba4
commit 2e2689c7c0
4 changed files with 29 additions and 2 deletions

View File

@@ -28,6 +28,7 @@ from django.utils.cache import get_max_age
from django.utils.encoding import iri_to_uri
from django.utils.html import escape
from django.utils.http import urlencode
from django.test.utils import override_settings
# local test models
from .models import (Article, BarAccount, CustomArticle, EmptyModel, FooAccount,
@@ -2756,6 +2757,15 @@ class PrePopulatedTest(TestCase):
self.assertNotContains(response, "id: '#id_slug'")
self.assertNotContains(response, "field['dependency_ids'].push('#id_title');")
self.assertNotContains(response, "id: '#id_prepopulatedsubpost_set-0-subslug',")
@override_settings(USE_THOUSAND_SEPARATOR = True, USE_L10N = True)
def test_prepopulated_maxlength_localized(self):
"""
Regression test for #15938: if USE_THOUSAND_SEPARATOR is set, make sure
that maxLength (in the javascript) is rendered without separators.
"""
response = self.client.get('/test_admin/admin/admin_views/prepopulatedpostlargeslug/add/')
self.assertContains(response, "maxLength: 1000") # instead of 1,000
class ReadonlyTest(TestCase):
urls = "regressiontests.admin_views.urls"