diff options
| author | Justin Bronn <jbronn@gmail.com> | 2007-10-16 16:54:23 +0000 |
|---|---|---|
| committer | Justin Bronn <jbronn@gmail.com> | 2007-10-16 16:54:23 +0000 |
| commit | 58fc7897653b0a64658b3ece5d0ff429b4636130 (patch) | |
| tree | 95ed4b510620ad3740b16cdff1395b4f10dbaee4 /tests | |
| parent | ba9fa9844c7996bf1362b9769c2c2fecf760a039 (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')
| -rw-r--r-- | tests/modeltests/basic/models.py | 2 | ||||
| -rw-r--r-- | tests/modeltests/field_defaults/models.py | 2 | ||||
| -rw-r--r-- | tests/regressiontests/datastructures/tests.py | 8 | ||||
| -rw-r--r-- | tests/regressiontests/i18n/models.py | 12 | ||||
| -rw-r--r-- | tests/regressiontests/i18n/tests.py | 8 |
5 files changed, 30 insertions, 2 deletions
diff --git a/tests/modeltests/basic/models.py b/tests/modeltests/basic/models.py index 58770ef2ce..2f4b932fe0 100644 --- a/tests/modeltests/basic/models.py +++ b/tests/modeltests/basic/models.py @@ -152,7 +152,7 @@ TypeError: 'foo' is an invalid keyword argument for this function >>> a6 = Article(pub_date=datetime(2005, 7, 31)) >>> a6.save() >>> a6.headline -'Default headline' +u'Default headline' # For DateTimeFields, Django saves as much precision (in seconds) as you # give it. diff --git a/tests/modeltests/field_defaults/models.py b/tests/modeltests/field_defaults/models.py index 23c4733b8f..1132f1ca41 100644 --- a/tests/modeltests/field_defaults/models.py +++ b/tests/modeltests/field_defaults/models.py @@ -42,7 +42,7 @@ __test__ = {'API_TESTS':""" # Access database columns via Python attributes. >>> a.headline -'Default headline' +u'Default headline' # make sure the two dates are sufficiently close >>> d = now - a.pub_date 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' """ |
