Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Removed one test that is only intended for PostgreSQL from the visibi…

…lity of

other databases. This basically hides an annoying warning when running the
tests under MySQL.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@9649 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit fddc0c589e03c1e5eb581aaa947a39720163d7d5 1 parent b96b450
Malcolm Tredinnick authored

Showing 1 changed file with 7 additions and 2 deletions. Show diff stats Hide diff stats

  1. 9  tests/modeltests/lookup/models.py
9  tests/modeltests/lookup/models.py
@@ -16,7 +16,7 @@ class Meta:
16 16
     def __unicode__(self):
17 17
         return self.headline
18 18
 
19  
-__test__ = {'API_TESTS':r"""
  19
+__test__ = {'API_TESTS': r"""
20 20
 # Create a couple of Articles.
21 21
 >>> from datetime import datetime
22 22
 >>> a1 = Article(headline='Article 1', pub_date=datetime(2005, 7, 26))
@@ -33,13 +33,18 @@ def __unicode__(self):
33 33
 >>> a6.save()
34 34
 >>> a7 = Article(headline='Article 7', pub_date=datetime(2005, 7, 27))
35 35
 >>> a7.save()
  36
+"""}
36 37
 
  38
+if settings.DATABASE_ENGINE in ('postgresql', 'postgresql_pysycopg2'):
  39
+    __test__['API_TESTS'] += r"""
37 40
 # text matching tests for PostgreSQL 8.3
38 41
 >>> Article.objects.filter(id__iexact='1')
39 42
 [<Article: Article 1>]
40 43
 >>> Article.objects.filter(pub_date__startswith='2005')
41 44
 [<Article: Article 5>, <Article: Article 6>, <Article: Article 4>, <Article: Article 2>, <Article: Article 3>, <Article: Article 7>, <Article: Article 1>]
  45
+"""
42 46
 
  47
+__test__['API_TESTS'] += r"""
43 48
 # Each QuerySet gets iterator(), which is a generator that "lazily" returns
44 49
 # results using database-level iteration.
45 50
 >>> for a in Article.objects.iterator():
@@ -383,7 +388,7 @@ def __unicode__(self):
383 388
 [<Article: barfoobaz>, <Article: baz>, <Article: bazbaRFOO>, <Article: foobarbaz>, <Article: foobaz>]
384 389
 >>> Article.objects.filter(headline__iregex=r'b.*ar')
385 390
 [<Article: bar>, <Article: barfoobaz>, <Article: bazbaRFOO>, <Article: foobar>, <Article: foobarbaz>]
386  
-"""}
  391
+"""
387 392
 
388 393
 
389 394
 if settings.DATABASE_ENGINE != 'mysql':

0 notes on commit fddc0c5

Please sign in to comment.
Something went wrong with that request. Please try again.