Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alain Takoudjou
erp5
Commits
55985c7d
Commit
55985c7d
authored
Oct 27, 2014
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
full_text: update testERP5Catalog.py.
parent
8418c9c4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
48 deletions
+48
-48
product/ERP5Catalog/tests/testERP5Catalog.py
product/ERP5Catalog/tests/testERP5Catalog.py
+48
-48
No files found.
product/ERP5Catalog/tests/testERP5Catalog.py
View file @
55985c7d
...
@@ -44,7 +44,7 @@ from Products.ERP5Type.tests.utils import createZODBPythonScript, todo_erp5, \
...
@@ -44,7 +44,7 @@ from Products.ERP5Type.tests.utils import createZODBPythonScript, todo_erp5, \
from
Products.ZSQLCatalog.ZSQLCatalog
import
HOT_REINDEXING_FINISHED_STATE
,
\
from
Products.ZSQLCatalog.ZSQLCatalog
import
HOT_REINDEXING_FINISHED_STATE
,
\
HOT_REINDEXING_RECORDING_STATE
,
HOT_REINDEXING_DOUBLE_INDEXING_STATE
HOT_REINDEXING_RECORDING_STATE
,
HOT_REINDEXING_DOUBLE_INDEXING_STATE
from
Products.CMFActivity.Errors
import
ActivityFlushError
from
Products.CMFActivity.Errors
import
ActivityFlushError
from
Products.ZSQLCatalog.SQLCatalog
import
Query
,
ComplexQuery
from
Products.ZSQLCatalog.SQLCatalog
import
Query
,
ComplexQuery
,
SimpleQuery
from
OFS.ObjectManager
import
ObjectManager
from
OFS.ObjectManager
import
ObjectManager
...
@@ -189,7 +189,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
...
@@ -189,7 +189,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
person
=
person_module
.
newContent
(
id
=
'1'
,
portal_type
=
'Person'
)
person
=
person_module
.
newContent
(
id
=
'1'
,
portal_type
=
'Person'
)
path_list
=
[
person
.
getRelativeUrl
()]
path_list
=
[
person
.
getRelativeUrl
()]
self
.
checkRelativeUrlNotInSQLPathList
(
path_list
)
self
.
checkRelativeUrlNotInSQLPathList
(
path_list
)
person
.
immediateReindexObject
()
self
.
tic
()
self
.
checkRelativeUrlInSQLPathList
(
path_list
)
self
.
checkRelativeUrlInSQLPathList
(
path_list
)
person_module
.
manage_delObjects
(
'1'
)
person_module
.
manage_delObjects
(
'1'
)
self
.
tic
()
self
.
tic
()
...
@@ -197,10 +197,10 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
...
@@ -197,10 +197,10 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
# Now we will ask to immediatly reindex
# Now we will ask to immediatly reindex
person
=
person_module
.
newContent
(
id
=
'2'
,
person
=
person_module
.
newContent
(
id
=
'2'
,
portal_type
=
'Person'
,)
portal_type
=
'Person'
,)
person
.
immediateReindexObject
()
self
.
tic
()
path_list
=
[
person
.
getRelativeUrl
()]
path_list
=
[
person
.
getRelativeUrl
()]
self
.
checkRelativeUrlInSQLPathList
(
path_list
)
self
.
checkRelativeUrlInSQLPathList
(
path_list
)
person
.
immediateReindexObject
()
self
.
tic
()
self
.
checkRelativeUrlInSQLPathList
(
path_list
)
self
.
checkRelativeUrlInSQLPathList
(
path_list
)
person_module
.
manage_delObjects
(
'2'
)
person_module
.
manage_delObjects
(
'2'
)
self
.
tic
()
self
.
tic
()
...
@@ -209,7 +209,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
...
@@ -209,7 +209,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
person
=
person_module
.
newContent
(
id
=
'3'
,
portal_type
=
'Person'
)
person
=
person_module
.
newContent
(
id
=
'3'
,
portal_type
=
'Person'
)
path_list
=
[
person
.
getRelativeUrl
()]
path_list
=
[
person
.
getRelativeUrl
()]
self
.
checkRelativeUrlNotInSQLPathList
(
path_list
)
self
.
checkRelativeUrlNotInSQLPathList
(
path_list
)
person
.
immediateReindexObject
()
self
.
tic
()
self
.
checkRelativeUrlInSQLPathList
(
path_list
)
self
.
checkRelativeUrlInSQLPathList
(
path_list
)
person_module
.
deleteContent
(
'3'
)
person_module
.
deleteContent
(
'3'
)
# Now delete things is made with activities
# Now delete things is made with activities
...
@@ -223,10 +223,10 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
...
@@ -223,10 +223,10 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
folder_object_list
=
[
x
.
getObject
().
getId
()
for
x
in
person_module
.
searchFolder
()]
folder_object_list
=
[
x
.
getObject
().
getId
()
for
x
in
person_module
.
searchFolder
()]
self
.
assertEqual
([],
folder_object_list
)
self
.
assertEqual
([],
folder_object_list
)
person
=
person_module
.
newContent
(
id
=
'4'
,
portal_type
=
'Person'
,)
person
=
person_module
.
newContent
(
id
=
'4'
,
portal_type
=
'Person'
,)
person
.
immediateReindexObject
()
self
.
tic
()
folder_object_list
=
[
x
.
getObject
().
getId
()
for
x
in
person_module
.
searchFolder
()]
folder_object_list
=
[
x
.
getObject
().
getId
()
for
x
in
person_module
.
searchFolder
()]
self
.
assertEqual
([
'4'
],
folder_object_list
)
self
.
assertEqual
([
'4'
],
folder_object_list
)
person
.
immediateReindexObject
()
self
.
tic
()
person_module
.
manage_delObjects
(
'4'
)
person_module
.
manage_delObjects
(
'4'
)
self
.
tic
()
self
.
tic
()
folder_object_list
=
[
x
.
getObject
().
getId
()
for
x
in
person_module
.
searchFolder
()]
folder_object_list
=
[
x
.
getObject
().
getId
()
for
x
in
person_module
.
searchFolder
()]
...
@@ -240,7 +240,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
...
@@ -240,7 +240,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
self
.
assertEqual
([],
folder_object_list
)
self
.
assertEqual
([],
folder_object_list
)
person
=
person_module
.
newContent
(
id
=
'4'
,
portal_type
=
'Person'
)
person
=
person_module
.
newContent
(
id
=
'4'
,
portal_type
=
'Person'
)
person
.
immediateReindexObject
()
self
.
tic
()
folder_object_list
=
[
x
.
getObject
().
getId
()
for
x
in
person_module
.
searchFolder
()]
folder_object_list
=
[
x
.
getObject
().
getId
()
for
x
in
person_module
.
searchFolder
()]
self
.
assertEqual
([
'4'
],
folder_object_list
)
self
.
assertEqual
([
'4'
],
folder_object_list
)
...
@@ -274,7 +274,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
...
@@ -274,7 +274,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
portal_catalog
.
manage_catalogClear
()
portal_catalog
.
manage_catalogClear
()
person
=
person_module
.
newContent
(
id
=
'4'
,
portal_type
=
'Person'
)
person
=
person_module
.
newContent
(
id
=
'4'
,
portal_type
=
'Person'
)
person
.
immediateReindexObject
()
self
.
tic
()
folder_object_list
=
[
x
.
getObject
().
getId
()
for
x
in
person_module
.
searchFolder
()]
folder_object_list
=
[
x
.
getObject
().
getId
()
for
x
in
person_module
.
searchFolder
()]
self
.
assertEqual
([
'4'
],
folder_object_list
)
self
.
assertEqual
([
'4'
],
folder_object_list
)
...
@@ -298,7 +298,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
...
@@ -298,7 +298,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
portal_catalog
.
manage_catalogClear
()
portal_catalog
.
manage_catalogClear
()
person
=
person_module
.
newContent
(
id
=
'4'
,
portal_type
=
'Person'
)
person
=
person_module
.
newContent
(
id
=
'4'
,
portal_type
=
'Person'
)
person
.
immediateReindexObject
()
self
.
tic
()
folder_object_list
=
[
x
.
getObject
().
getId
()
for
x
in
person_module
.
searchFolder
()]
folder_object_list
=
[
x
.
getObject
().
getId
()
for
x
in
person_module
.
searchFolder
()]
self
.
assertEqual
([
'4'
],
folder_object_list
)
self
.
assertEqual
([
'4'
],
folder_object_list
)
...
@@ -310,11 +310,11 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
...
@@ -310,11 +310,11 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
portal_catalog
.
manage_catalogClear
()
portal_catalog
.
manage_catalogClear
()
person
=
person_module
.
newContent
(
id
=
'a'
,
portal_type
=
'Person'
,
title
=
'a'
,
description
=
'z'
)
person
=
person_module
.
newContent
(
id
=
'a'
,
portal_type
=
'Person'
,
title
=
'a'
,
description
=
'z'
)
person
.
immediateReindexObject
()
self
.
tic
()
person
=
person_module
.
newContent
(
id
=
'b'
,
portal_type
=
'Person'
,
title
=
'a'
,
description
=
'y'
)
person
=
person_module
.
newContent
(
id
=
'b'
,
portal_type
=
'Person'
,
title
=
'a'
,
description
=
'y'
)
person
.
immediateReindexObject
()
self
.
tic
()
person
=
person_module
.
newContent
(
id
=
'c'
,
portal_type
=
'Person'
,
title
=
'a'
,
description
=
'x'
)
person
=
person_module
.
newContent
(
id
=
'c'
,
portal_type
=
'Person'
,
title
=
'a'
,
description
=
'x'
)
person
.
immediateReindexObject
()
self
.
tic
()
folder_object_list
=
[
x
.
getObject
().
getId
()
folder_object_list
=
[
x
.
getObject
().
getId
()
for
x
in
person_module
.
searchFolder
(
sort_on
=
[(
'id'
,
'ascending'
)])]
for
x
in
person_module
.
searchFolder
(
sort_on
=
[(
'id'
,
'ascending'
)])]
self
.
assertEqual
([
'a'
,
'b'
,
'c'
],
folder_object_list
)
self
.
assertEqual
([
'a'
,
'b'
,
'c'
],
folder_object_list
)
...
@@ -335,11 +335,11 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
...
@@ -335,11 +335,11 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
portal_catalog
.
manage_catalogClear
()
portal_catalog
.
manage_catalogClear
()
person
=
person_module
.
newContent
(
id
=
'a'
,
portal_type
=
'Person'
,
title
=
'1'
)
person
=
person_module
.
newContent
(
id
=
'a'
,
portal_type
=
'Person'
,
title
=
'1'
)
person
.
immediateReindexObject
()
self
.
tic
()
person
=
person_module
.
newContent
(
id
=
'b'
,
portal_type
=
'Person'
,
title
=
'2'
)
person
=
person_module
.
newContent
(
id
=
'b'
,
portal_type
=
'Person'
,
title
=
'2'
)
person
.
immediateReindexObject
()
self
.
tic
()
person
=
person_module
.
newContent
(
id
=
'c'
,
portal_type
=
'Person'
,
title
=
'12'
)
person
=
person_module
.
newContent
(
id
=
'c'
,
portal_type
=
'Person'
,
title
=
'12'
)
person
.
immediateReindexObject
()
self
.
tic
()
folder_object_list
=
[
x
.
getObject
().
getTitle
()
for
x
in
person_module
.
searchFolder
(
sort_on
=
[(
'title'
,
'ascending'
)])]
folder_object_list
=
[
x
.
getObject
().
getTitle
()
for
x
in
person_module
.
searchFolder
(
sort_on
=
[(
'title'
,
'ascending'
)])]
self
.
assertEqual
([
'1'
,
'12'
,
'2'
],
folder_object_list
)
self
.
assertEqual
([
'1'
,
'12'
,
'2'
],
folder_object_list
)
folder_object_list
=
[
x
.
getObject
().
getTitle
()
for
x
in
person_module
.
searchFolder
(
sort_on
=
[(
'title'
,
'ascending'
,
'int'
)])]
folder_object_list
=
[
x
.
getObject
().
getTitle
()
for
x
in
person_module
.
searchFolder
(
sort_on
=
[(
'title'
,
'ascending'
,
'int'
)])]
...
@@ -654,7 +654,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
...
@@ -654,7 +654,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
title
=
'Sébastien'
title
=
'Sébastien'
person
=
person_module
.
newContent
(
id
=
'5'
,
portal_type
=
'Person'
,
title
=
title
)
person
=
person_module
.
newContent
(
id
=
'5'
,
portal_type
=
'Person'
,
title
=
title
)
person
.
immediateReindexObject
()
self
.
tic
()
folder_object_list
=
[
x
.
getObject
().
getId
()
for
x
in
person_module
.
searchFolder
()]
folder_object_list
=
[
x
.
getObject
().
getId
()
for
x
in
person_module
.
searchFolder
()]
self
.
assertEqual
([
'5'
],
folder_object_list
)
self
.
assertEqual
([
'5'
],
folder_object_list
)
folder_object_list
=
[
x
.
getObject
().
getId
()
for
x
in
folder_object_list
=
[
x
.
getObject
().
getId
()
for
x
in
...
@@ -666,7 +666,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
...
@@ -666,7 +666,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
title
=
'Sébastien'
title
=
'Sébastien'
person
=
person_module
.
newContent
(
id
=
'5'
,
portal_type
=
'Person'
,
title
=
title
)
person
=
person_module
.
newContent
(
id
=
'5'
,
portal_type
=
'Person'
,
title
=
title
)
person
.
immediateReindexObject
()
self
.
tic
()
folder_object_list
=
[
x
.
getObject
().
getId
()
for
x
in
folder_object_list
=
[
x
.
getObject
().
getId
()
for
x
in
person_module
.
searchFolder
(
title
=
title
)]
person_module
.
searchFolder
(
title
=
title
)]
self
.
assertEqual
([
'5'
],
folder_object_list
)
self
.
assertEqual
([
'5'
],
folder_object_list
)
...
@@ -793,7 +793,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
...
@@ -793,7 +793,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
# Now we will ask to immediatly reindex
# Now we will ask to immediatly reindex
person
=
person_module
.
newContent
(
id
=
'2'
,
person
=
person_module
.
newContent
(
id
=
'2'
,
portal_type
=
'Person'
,)
portal_type
=
'Person'
,)
person
.
immediateReindexObject
()
self
.
tic
()
path_list
=
[
person
.
getRelativeUrl
()]
path_list
=
[
person
.
getRelativeUrl
()]
self
.
checkRelativeUrlInSQLPathList
(
path_list
)
self
.
checkRelativeUrlInSQLPathList
(
path_list
)
# We will delete the connector
# We will delete the connector
...
@@ -855,19 +855,19 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
...
@@ -855,19 +855,19 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
"""Sort-on parameter and related key. (Assumes that region_title is a
\
"""Sort-on parameter and related key. (Assumes that region_title is a
\
valid related key)"""
valid related key)"""
self
.
assertTrue
(
self
.
assertTrue
(
self
.
getCatalogTool
().
buildSQLQuery
(
region_
titl
e
=
'foo'
,
self
.
getCatalogTool
().
buildSQLQuery
(
region_
referenc
e
=
'foo'
,
sort_on
=
((
'region_
title'
,
'ascending'
),))[
'order_by_expression'
].
endswith
(
'.`titl
e` ASC'
))
sort_on
=
((
'region_
reference'
,
'ascending'
),))[
'order_by_expression'
].
endswith
(
'.`referenc
e` ASC'
))
self
.
assertTrue
(
self
.
assertTrue
(
self
.
getCatalogTool
().
buildSQLQuery
(
region_
titl
e
=
'foo'
,
self
.
getCatalogTool
().
buildSQLQuery
(
region_
referenc
e
=
'foo'
,
sort_on
=
((
'region_
title'
,
'descending'
),))[
'order_by_expression'
].
endswith
(
'.`titl
e` DESC'
))
sort_on
=
((
'region_
reference'
,
'descending'
),))[
'order_by_expression'
].
endswith
(
'.`referenc
e` DESC'
))
self
.
assertTrue
(
self
.
assertTrue
(
self
.
getCatalogTool
().
buildSQLQuery
(
self
.
getCatalogTool
().
buildSQLQuery
(
sort_on
=
((
'region_
title'
,
'ascending'
),))[
'order_by_expression'
].
endswith
(
'.`titl
e` ASC'
),
sort_on
=
((
'region_
reference'
,
'ascending'
),))[
'order_by_expression'
].
endswith
(
'.`referenc
e` ASC'
),
'sort_on parameter must be taken into account even if related key '
'sort_on parameter must be taken into account even if related key '
'is not a parameter of the current query'
)
'is not a parameter of the current query'
)
self
.
assertTrue
(
self
.
assertTrue
(
self
.
getCatalogTool
().
buildSQLQuery
(
self
.
getCatalogTool
().
buildSQLQuery
(
sort_on
=
((
'region_
title'
,
'descending'
),))[
'order_by_expression'
].
endswith
(
'.`titl
e` DESC'
),
sort_on
=
((
'region_
reference'
,
'descending'
),))[
'order_by_expression'
].
endswith
(
'.`referenc
e` DESC'
),
'sort_on parameter must be taken into account even if related key '
'sort_on parameter must be taken into account even if related key '
'is not a parameter of the current query'
)
'is not a parameter of the current query'
)
...
@@ -957,8 +957,8 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
...
@@ -957,8 +957,8 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
self
.
assertEqual
([
organisation
.
getPath
()],
self
.
assertEqual
([
organisation
.
getPath
()],
[
x
.
path
for
x
in
self
.
getCatalogTool
()(
[
x
.
path
for
x
in
self
.
getCatalogTool
()(
title
=
{
'query'
:
(
organisation_title
,
'something else'
),
**
{
'catalog.title'
:
{
'query'
:
(
organisation_title
,
'something else'
),
'operator'
:
'or'
})])
'operator'
:
'or'
}
})])
def
test_33_SimpleQueryDictWithAndOperator
(
self
):
def
test_33_SimpleQueryDictWithAndOperator
(
self
):
"""use a dict as a keyword parameter, with AND operator.
"""use a dict as a keyword parameter, with AND operator.
...
@@ -1149,20 +1149,19 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
...
@@ -1149,20 +1149,19 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
SearchableText
=
'title'
)[
0
][
0
])
SearchableText
=
'title'
)[
0
][
0
])
# 'different' is 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.
# MySQL ignores such a word, but Mroonga does not ignore.
try
:
if
'ENGINE=Mroonga'
in
self
.
portal
.
erp5_sql_connection
.
manage_test
(
self
.
portal
.
erp5_sql_connection
.
manage_test
(
'SHOW SENNA STATUS'
)
'SHOW CREATE TABLE full_text'
)[
0
][
1
]:
except
ProgrammingError
:
# Mroonga
self
.
assertEqual
(
10
,
self
.
getCatalogTool
().
countResults
(
portal_type
=
'Organisation'
,
SearchableText
=
'different'
)[
0
][
0
])
else
:
# MySQL
# MySQL
self
.
assertEqual
([],
self
.
assertEqual
([],
[
x
.
getObject
for
x
in
self
.
getCatalogTool
()(
[
x
.
getObject
for
x
in
self
.
getCatalogTool
()(
portal_type
=
'Organisation'
,
SearchableText
=
'different'
)])
portal_type
=
'Organisation'
,
SearchableText
=
'different'
)])
self
.
assertEqual
(
0
,
self
.
getCatalogTool
().
countResults
(
self
.
assertEqual
(
0
,
self
.
getCatalogTool
().
countResults
(
portal_type
=
'Organisation'
,
SearchableText
=
'different'
)[
0
][
0
])
portal_type
=
'Organisation'
,
SearchableText
=
'different'
)[
0
][
0
])
else
:
# Tritonn
self
.
assertEqual
(
10
,
self
.
getCatalogTool
().
countResults
(
portal_type
=
'Organisation'
,
SearchableText
=
'different'
)[
0
][
0
])
def
test_43_ManagePasteObject
(
self
):
def
test_43_ManagePasteObject
(
self
):
portal_catalog
=
self
.
getCatalogTool
()
portal_catalog
=
self
.
getCatalogTool
()
...
@@ -1221,11 +1220,11 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
...
@@ -1221,11 +1220,11 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
# Recursive Complex Query
# Recursive Complex Query
# (title='abc' and description='abc') OR
# (title='abc' and description='abc') OR
# title='foo' and description='bar'
# title='foo' and description='bar'
catalog_kw
=
{
'query'
:
ComplexQuery
(
ComplexQuery
(
Query
(
title
=
'abc'
),
catalog_kw
=
{
'query'
:
ComplexQuery
(
ComplexQuery
(
Simple
Query
(
title
=
'abc'
),
Query
(
description
=
'abc'
),
Simple
Query
(
description
=
'abc'
),
operator
=
'AND'
),
operator
=
'AND'
),
ComplexQuery
(
Query
(
title
=
'foo'
),
ComplexQuery
(
Simple
Query
(
title
=
'foo'
),
Query
(
description
=
'bar'
),
Simple
Query
(
description
=
'bar'
),
operator
=
'AND'
),
operator
=
'AND'
),
operator
=
'OR'
)}
operator
=
'OR'
)}
self
.
failIfDifferentSet
([
org_a
.
getPath
(),
org_f
.
getPath
()],
self
.
failIfDifferentSet
([
org_a
.
getPath
(),
org_f
.
getPath
()],
...
@@ -1578,11 +1577,11 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
...
@@ -1578,11 +1577,11 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
catalog
=
portal_catalog
.
objectValues
()[
0
]
catalog
=
portal_catalog
.
objectValues
()[
0
]
person
=
person_module
.
newContent
(
id
=
'a'
,
portal_type
=
'Person'
,
title
=
'a'
,
description
=
'z'
)
person
=
person_module
.
newContent
(
id
=
'a'
,
portal_type
=
'Person'
,
title
=
'a'
,
description
=
'z'
)
person
.
immediateReindexObject
()
self
.
tic
()
person
=
person_module
.
newContent
(
id
=
'b'
,
portal_type
=
'Person'
,
title
=
'a'
,
description
=
'y'
)
person
=
person_module
.
newContent
(
id
=
'b'
,
portal_type
=
'Person'
,
title
=
'a'
,
description
=
'y'
)
person
.
immediateReindexObject
()
self
.
tic
()
person
=
person_module
.
newContent
(
id
=
'c'
,
portal_type
=
'Person'
,
title
=
'a'
,
description
=
'x'
)
person
=
person_module
.
newContent
(
id
=
'c'
,
portal_type
=
'Person'
,
title
=
'a'
,
description
=
'x'
)
person
.
immediateReindexObject
()
self
.
tic
()
index_columns
=
getattr
(
catalog
,
'sql_catalog_index_on_order_keys'
,
None
)
index_columns
=
getattr
(
catalog
,
'sql_catalog_index_on_order_keys'
,
None
)
self
.
assertNotEqual
(
index_columns
,
None
)
self
.
assertNotEqual
(
index_columns
,
None
)
self
.
assertEqual
(
len
(
index_columns
),
0
)
self
.
assertEqual
(
len
(
index_columns
),
0
)
...
@@ -3768,7 +3767,7 @@ VALUES
...
@@ -3768,7 +3767,7 @@ VALUES
title
=
'foo (bar)'
title
=
'foo (bar)'
person
=
person_module
.
newContent
(
portal_type
=
'Person'
,
title
=
title
)
person
=
person_module
.
newContent
(
portal_type
=
'Person'
,
title
=
title
)
person_id
=
person
.
getId
()
person_id
=
person
.
getId
()
person
.
immediateReindexObject
()
self
.
tic
()
folder_object_list
=
[
x
.
getObject
().
getId
()
for
x
in
person_module
.
searchFolder
()]
folder_object_list
=
[
x
.
getObject
().
getId
()
for
x
in
person_module
.
searchFolder
()]
self
.
assertTrue
(
person_id
in
folder_object_list
)
self
.
assertTrue
(
person_id
in
folder_object_list
)
folder_object_list
=
[
x
.
getObject
().
getId
()
for
x
in
folder_object_list
=
[
x
.
getObject
().
getId
()
for
x
in
...
@@ -3781,15 +3780,16 @@ VALUES
...
@@ -3781,15 +3780,16 @@ VALUES
# Make sure that the catalog will not split it with such research :
# Make sure that the catalog will not split it with such research :
# title=foo AND title=bar
# title=foo AND title=bar
title
=
'foo bar'
title
=
'foo bar'
person_module
.
newContent
(
portal_type
=
'Person'
,
title
=
title
).
immediateReindexObject
()
person_module
.
newContent
(
portal_type
=
'Person'
,
title
=
title
)
self
.
tic
()
title
=
title
.
replace
(
' '
,
' '
)
title
=
title
.
replace
(
' '
,
' '
)
person
=
person_module
.
newContent
(
portal_type
=
'Person'
,
title
=
title
)
person
=
person_module
.
newContent
(
portal_type
=
'Person'
,
title
=
title
)
person_id
=
person
.
getId
()
person_id
=
person
.
getId
()
person
.
immediateReindexObject
()
self
.
tic
()
folder_object_list
=
[
x
.
getObject
().
getId
()
for
x
in
person_module
.
searchFolder
()]
folder_object_list
=
[
x
.
getObject
().
getId
()
for
x
in
person_module
.
searchFolder
()]
self
.
assertTrue
(
person_id
in
folder_object_list
)
self
.
assertTrue
(
person_id
in
folder_object_list
)
folder_object_list
=
[
x
.
getObject
().
getId
()
for
x
in
folder_object_list
=
[
x
.
getObject
().
getId
()
for
x
in
person_module
.
searchFolder
(
title
=
title
)]
person_module
.
searchFolder
(
**
{
'catalog.title'
:
title
}
)]
self
.
assertEqual
([
person_id
],
folder_object_list
)
self
.
assertEqual
([
person_id
],
folder_object_list
)
def
test_SearchFolderWithSingleQuote
(
self
):
def
test_SearchFolderWithSingleQuote
(
self
):
...
@@ -3800,7 +3800,7 @@ VALUES
...
@@ -3800,7 +3800,7 @@ VALUES
title
=
"foo 'bar"
title
=
"foo 'bar"
person
=
person_module
.
newContent
(
portal_type
=
'Person'
,
title
=
title
)
person
=
person_module
.
newContent
(
portal_type
=
'Person'
,
title
=
title
)
person_id
=
person
.
getId
()
person_id
=
person
.
getId
()
person
.
immediateReindexObject
()
self
.
tic
()
folder_object_list
=
[
x
.
getObject
().
getId
()
for
x
in
person_module
.
searchFolder
()]
folder_object_list
=
[
x
.
getObject
().
getId
()
for
x
in
person_module
.
searchFolder
()]
self
.
assertTrue
(
person_id
in
folder_object_list
)
self
.
assertTrue
(
person_id
in
folder_object_list
)
folder_object_list
=
[
x
.
getObject
().
getId
()
for
x
in
folder_object_list
=
[
x
.
getObject
().
getId
()
for
x
in
...
@@ -3817,7 +3817,7 @@ VALUES
...
@@ -3817,7 +3817,7 @@ VALUES
person
=
person_module
.
newContent
(
portal_type
=
'Person'
,
title
=
title
,
person
=
person_module
.
newContent
(
portal_type
=
'Person'
,
title
=
title
,
description
=
description
)
description
=
description
)
person_uid
=
person
.
getUid
()
person_uid
=
person
.
getUid
()
person
.
immediateReindexObject
()
self
.
tic
()
folder_object_list
=
person_module
.
searchFolder
(
uid
=
person_uid
,
select_dict
=
{
'title'
:
None
})
folder_object_list
=
person_module
.
searchFolder
(
uid
=
person_uid
,
select_dict
=
{
'title'
:
None
})
new_title
=
'bar'
new_title
=
'bar'
new_description
=
'foobarfoo'
new_description
=
'foobarfoo'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment