Skip to content

Commit

Permalink
[1.0.X] Fixed a false failure in the test suite when running Oracle. …
Browse files Browse the repository at this point in the history
…Backport of [10125] from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10126 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
nightflyerkilo committed Mar 23, 2009
1 parent ebfe7fa commit 7499416
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tests/regressiontests/queries/models.py
Expand Up @@ -830,7 +830,7 @@ def __unicode__(self):
A values() or values_list() query across joined models must use outer joins A values() or values_list() query across joined models must use outer joins
appropriately. appropriately.
>>> Report.objects.values_list("creator__extra__info", flat=True).order_by("name") >>> Report.objects.values_list("creator__extra__info", flat=True).order_by("name")
[u'e1', u'e2', None] [u'e1', u'e2', <NONE_OR_EMPTY_UNICODE>]
Similarly for select_related(), joins beyond an initial nullable join must Similarly for select_related(), joins beyond an initial nullable join must
use outer joins so that all results are included. use outer joins so that all results are included.
Expand Down Expand Up @@ -1115,6 +1115,14 @@ def __unicode__(self):
""" """



# In Oracle, we expect a null CharField to return u'' instead of None.
if settings.DATABASE_ENGINE == "oracle":
__test__["API_TESTS"] = __test__["API_TESTS"].replace("<NONE_OR_EMPTY_UNICODE>", "u''")
else:
__test__["API_TESTS"] = __test__["API_TESTS"].replace("<NONE_OR_EMPTY_UNICODE>", "None")


# Generator expressions are only in Python 2.4 and later. # Generator expressions are only in Python 2.4 and later.
if sys.version_info >= (2, 4): if sys.version_info >= (2, 4):
__test__["API_TESTS"] += """ __test__["API_TESTS"] += """
Expand Down

0 comments on commit 7499416

Please sign in to comment.