Commit 39322ab5 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

modify test_42_SearchableText so as to pass on both MySQL and Tritonn.

(MySQL ignores a word included in too many records, but Tritonn does not.)


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@31208 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 71cd7213
......@@ -28,6 +28,7 @@
import unittest
import sys
from _mysql_exceptions import ProgrammingError
from Testing import ZopeTestCase
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
......@@ -1323,18 +1324,24 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
self.assertEquals([ob],
[x.getObject() for x in self.getCatalogTool()(
portal_type='Organisation', SearchableText='title')])
self.assertEquals(1, self.getCatalogTool().countResults(
portal_type='Organisation', SearchableText='title')[0][0])
# 'different' is not revelant, because it's found in more than 50% of
# records
# 'different' is found in more than 50% of records
# MySQL ignores such a word, but Tritonn does not ignore.
try:
self.portal.erp5_sql_connection.manage_test('SHOW SENNA STATUS')
except ProgrammingError:
# MySQL
self.assertEquals([],
[x.getObject for x in self.getCatalogTool()(
portal_type='Organisation', SearchableText='different')])
# test countResults
self.assertEquals(1, self.getCatalogTool().countResults(
portal_type='Organisation', SearchableText='title')[0][0])
self.assertEquals(0, self.getCatalogTool().countResults(
portal_type='Organisation', SearchableText='different')[0][0])
else:
# Tritonn
self.assertEquals(10, self.getCatalogTool().countResults(
portal_type='Organisation', SearchableText='different')[0][0])
def test_43_ManagePasteObject(self, quiet=quiet, run=run_all_test):
if not run: return
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment