summaryrefslogtreecommitdiff
path: root/tests/regressiontests
diff options
context:
space:
mode:
authorJustin Bronn <jbronn@gmail.com>2007-10-16 16:54:23 +0000
committerJustin Bronn <jbronn@gmail.com>2007-10-16 16:54:23 +0000
commit58fc7897653b0a64658b3ece5d0ff429b4636130 (patch)
tree95ed4b510620ad3740b16cdff1395b4f10dbaee4 /tests/regressiontests
parentba9fa9844c7996bf1362b9769c2c2fecf760a039 (diff)
Merged revisions 6442-6524 via svnmerge from [repos:django/trunk trunk].
git-svn-id: http://code.djangoproject.com/svn/django/branches/gis@6525 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests')
-rw-r--r--tests/regressiontests/datastructures/tests.py8
-rw-r--r--tests/regressiontests/i18n/models.py12
-rw-r--r--tests/regressiontests/i18n/tests.py8
3 files changed, 28 insertions, 0 deletions
diff --git a/tests/regressiontests/datastructures/tests.py b/tests/regressiontests/datastructures/tests.py
index 3920e1ca40..b58ee79693 100644
--- a/tests/regressiontests/datastructures/tests.py
+++ b/tests/regressiontests/datastructures/tests.py
@@ -55,6 +55,14 @@ True
>>> print repr(d)
{'one': 'not one', 'two': 'two', 'three': 'three'}
+Init from sequence of tuples
+>>> d = SortedDict((
+... (1, "one"),
+... (0, "zero"),
+... (2, "two")))
+>>> print repr(d)
+{1: 'one', 0: 'zero', 2: 'two'}
+
### DotExpandedDict ############################################################
>>> d = DotExpandedDict({'person.1.firstname': ['Simon'], 'person.1.lastname': ['Willison'], 'person.2.firstname': ['Adrian'], 'person.2.lastname': ['Holovaty']})
diff --git a/tests/regressiontests/i18n/models.py b/tests/regressiontests/i18n/models.py
index e69de29bb2..e1eefb8477 100644
--- a/tests/regressiontests/i18n/models.py
+++ b/tests/regressiontests/i18n/models.py
@@ -0,0 +1,12 @@
+from django.db import models
+from django.utils.translation import ugettext_lazy as _
+
+class TestModel(models.Model):
+ text = models.CharField(max_length=10, default=_('Anything'))
+
+__test__ = {'API_TESTS': '''
+>>> tm = TestModel()
+>>> tm.save()
+'''
+}
+
diff --git a/tests/regressiontests/i18n/tests.py b/tests/regressiontests/i18n/tests.py
index 8a7d2bee3e..99204451e4 100644
--- a/tests/regressiontests/i18n/tests.py
+++ b/tests/regressiontests/i18n/tests.py
@@ -30,4 +30,12 @@ True
>>> s4 = ugettext_lazy('Some other string')
>>> s == s4
False
+
+unicode(string_concat(...)) should not raise a TypeError - #4796
+
+>>> import django.utils.translation
+>>> reload(django.utils.translation)
+<module 'django.utils.translation' from ...>
+>>> unicode(django.utils.translation.string_concat("dja", "ngo"))
+u'django'
"""