diff test/db_test_base.py @ 4787:4a017661e414

Closed issue2550805 (Postgresql should search title case insensitive), by Tom Ekberg.
author Bernhard Reiter <bernhard@intevation.de>
date Fri, 10 May 2013 23:24:10 +0200
parents 6018617c55ab
children e68920390aad
line wrap: on
line diff
--- a/test/db_test_base.py	Sun May 05 00:21:27 2013 +0200
+++ b/test/db_test_base.py	Fri May 10 23:24:10 2013 +0200
@@ -1235,6 +1235,23 @@
             ae(filt(None, {'title': ['one', 'two']}, ('+','id'), (None,None)),
                 [])
 
+    def testFilteringStringCase(self):
+        """
+        Similar to testFilteringString except the search parameters
+        have different capitalization.
+        """
+        ae, filter, filter_iter = self.filteringSetup()
+        for filt in filter, filter_iter:
+            ae(filt(None, {'title': ['One']}, ('+','id'), (None,None)), ['1'])
+            ae(filt(None, {'title': ['Issue One']}, ('+','id'), (None,None)),
+                ['1'])
+            ae(filt(None, {'title': ['ISSUE', 'ONE']}, ('+','id'), (None,None)),
+                ['1'])
+            ae(filt(None, {'title': ['iSSUE']}, ('+','id'), (None,None)),
+                ['1','2','3'])
+            ae(filt(None, {'title': ['One', 'Two']}, ('+','id'), (None,None)),
+                [])
+
     def testFilteringLink(self):
         ae, filter, filter_iter = self.filteringSetup()
         a = 'assignedto'

Roundup Issue Tracker: http://roundup-tracker.org/