Author: mtredinnick
Date: 2008-12-16 00:48:15 -0600 (Tue, 16 Dec 2008)
New Revision: 9651
Modified:
django/branches/releases/1.0.X/tests/modeltests/lookup/models.py
Log:
[1.0.X] Removed one test that is only intended for PostgreSQL from the
visibility of other databases. This basically hides an annoying warning when
running the tests under MySQL.
Backport of r9469 from trunk.
Modified: django/branches/releases/1.0.X/tests/modeltests/lookup/models.py
===================================================================
--- django/branches/releases/1.0.X/tests/modeltests/lookup/models.py
2008-12-16 06:43:18 UTC (rev 9650)
+++ django/branches/releases/1.0.X/tests/modeltests/lookup/models.py
2008-12-16 06:48:15 UTC (rev 9651)
@@ -16,7 +16,7 @@
def __unicode__(self):
return self.headline
-__test__ = {'API_TESTS':r"""
+__test__ = {'API_TESTS': r"""
# Create a couple of Articles.
>>> from datetime import datetime
>>> a1 = Article(headline='Article 1', pub_date=datetime(2005, 7, 26))
@@ -33,13 +33,18 @@
>>> a6.save()
>>> a7 = Article(headline='Article 7', pub_date=datetime(2005, 7, 27))
>>> a7.save()
+"""}
+if settings.DATABASE_ENGINE in ('postgresql', 'postgresql_pysycopg2'):
+ __test__['API_TESTS'] += r"""
# text matching tests for PostgreSQL 8.3
>>> Article.objects.filter(id__iexact='1')
[<Article: Article 1>]
>>> Article.objects.filter(pub_date__startswith='2005')
[<Article: Article 5>, <Article: Article 6>, <Article: Article 4>, <Article:
Article 2>, <Article: Article 3>, <Article: Article 7>, <Article: Article 1>]
+"""
+__test__['API_TESTS'] += r"""
# Each QuerySet gets iterator(), which is a generator that "lazily" returns
# results using database-level iteration.
>>> for a in Article.objects.iterator():
@@ -383,7 +388,7 @@
[<Article: barfoobaz>, <Article: baz>, <Article: bazbaRFOO>, <Article:
foobarbaz>, <Article: foobaz>]
>>> Article.objects.filter(headline__iregex=r'b.*ar')
[<Article: bar>, <Article: barfoobaz>, <Article: bazbaRFOO>, <Article:
foobar>, <Article: foobarbaz>]
-"""}
+"""
if settings.DATABASE_ENGINE != 'mysql':
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---