1
0
mirror of https://github.com/django/django.git synced 2025-10-23 21:59:11 +00:00

Fixed #5672 -- Allow the separator in the get_text_list utility function to be translated. Thanks, Claude.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14876 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Jannis Leidel
2010-12-12 22:53:49 +00:00
parent 575962c213
commit 462d3115a3
4 changed files with 21 additions and 2 deletions

View File

@@ -4,12 +4,23 @@ from django.test import TestCase
from django.utils.text import *
from django.utils.http import urlquote, urlquote_plus, cookie_date, http_date
from django.utils.encoding import iri_to_uri
from django.utils.translation import activate, deactivate
class TextTests(TestCase):
"""
Tests for stuff in django.utils.text and other text munging util functions.
"""
def test_get_text_list(self):
self.assertEqual(get_text_list(['a', 'b', 'c', 'd']), u'a, b, c or d')
self.assertEqual(get_text_list(['a', 'b', 'c'], 'and'), u'a, b and c')
self.assertEqual(get_text_list(['a', 'b'], 'and'), u'a and b')
self.assertEqual(get_text_list(['a']), u'a')
self.assertEqual(get_text_list([]), u'')
activate('ar')
self.assertEqual(get_text_list(['a', 'b', 'c']), u"a، b أو c")
deactivate()
def test_smart_split(self):
self.assertEquals(list(smart_split(r'''This is "a person" test.''')),