From 518c4ca2a8ce589d8524357c47aba097cd29f47f Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Tue, 16 Dec 2008 06:48:15 +0000 Subject: [PATCH] [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. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9651 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- tests/modeltests/lookup/models.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/modeltests/lookup/models.py b/tests/modeltests/lookup/models.py index 1d39e0e22b..73a0424187 100644 --- a/tests/modeltests/lookup/models.py +++ b/tests/modeltests/lookup/models.py @@ -16,7 +16,7 @@ class Article(models.Model): 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 @@ __test__ = {'API_TESTS':r""" >>> 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.objects.filter(pub_date__startswith='2005') [, , , , , , ] +""" +__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 @@ FieldError: Join on field 'headline' not permitted. [, , , , ] >>> Article.objects.filter(headline__iregex=r'b.*ar') [, , , , ] -"""} +""" if settings.DATABASE_ENGINE != 'mysql':