From 08c55c3f152bb77de4681af92e65122146230e49 Mon Sep 17 00:00:00 2001
From: Vincent Pelletier <vincent@nexedi.com>
Date: Fri, 9 Oct 2009 13:54:33 +0000
Subject: [PATCH] Add a test checking that catalog does not double single
 quotes ("'" would become "''").

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@29533 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Catalog/tests/testERP5Catalog.py | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/product/ERP5Catalog/tests/testERP5Catalog.py b/product/ERP5Catalog/tests/testERP5Catalog.py
index ae2ff559cf..639b8512fe 100644
--- a/product/ERP5Catalog/tests/testERP5Catalog.py
+++ b/product/ERP5Catalog/tests/testERP5Catalog.py
@@ -3898,6 +3898,26 @@ VALUES
                               person_module.searchFolder(title=title)]
     self.assertEquals([person_id],folder_object_list)
  
+  def test_SearchFolderWithSingleQuote(self, quiet=quiet):
+    if not quiet:
+      message = 'Search Folder With Single Quote'
+      ZopeTestCase._print('\n%s ' % message)
+      LOG('Testing... ',0,message)
+
+    person_module = self.getPersonModule()
+
+    # Make sure that the catalog will not split it with such research :
+    # title=foo AND title=bar
+    title="foo 'bar"
+    person = person_module.newContent(portal_type='Person',title=title)
+    person_id = person.getId()
+    person.immediateReindexObject()
+    folder_object_list = [x.getObject().getId() for x in person_module.searchFolder()]
+    self.assertTrue(person_id in folder_object_list)
+    folder_object_list = [x.getObject().getId() for x in 
+                              person_module.searchFolder(title=title)]
+    self.assertEquals([person_id],folder_object_list)
+
 def test_suite():
   suite = unittest.TestSuite()
   suite.addTest(unittest.makeSuite(TestERP5Catalog))
-- 
2.30.9