summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-08-28 05:42:05 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-08-28 05:42:05 +0000
commit71dda1918408a5b15d27c5b2cd28fddcd747449d (patch)
treed362d05cae2b2b402b022a838a6ac894e7d3bb3b /tests
parentf749b84824fc11f2f57d5b0036a07ead13fd1a99 (diff)
Fixed #8597 -- Allow the use of strings containing underscores and percentage
signs in "iexact" queries on PostgreSQL again (this case was missed in [8536]). git-svn-id: http://code.djangoproject.com/svn/django/trunk@8646 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
-rw-r--r--tests/regressiontests/queries/models.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/regressiontests/queries/models.py b/tests/regressiontests/queries/models.py
index e2d56e185f..c524c6250e 100644
--- a/tests/regressiontests/queries/models.py
+++ b/tests/regressiontests/queries/models.py
@@ -901,6 +901,18 @@ Pickling of DateQuerySets used to fail
>>> qs = Item.objects.dates('created', 'month')
>>> _ = pickle.loads(pickle.dumps(qs))
+Bug #8597: regression tests for case-insensitive comparisons
+>>> _ = Item.objects.create(name="a_b", created=datetime.datetime.now(), creator=a2, note=n1)
+>>> _ = Item.objects.create(name="x%y", created=datetime.datetime.now(), creator=a2, note=n1)
+>>> Item.objects.filter(name__iexact="A_b")
+[<Item: a_b>]
+>>> Item.objects.filter(name__iexact="x%Y")
+[<Item: x%y>]
+>>> Item.objects.filter(name__istartswith="A_b")
+[<Item: a_b>]
+>>> Item.objects.filter(name__iendswith="A_b")
+[<Item: a_b>]
+
"""}
# In Python 2.3 and the Python 2.6 beta releases, exceptions raised in __len__