Commit e4261ba1 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

use '=' comparison operator explicitly in title search.

parent 7e7f6adb
...@@ -53,6 +53,7 @@ ...@@ -53,6 +53,7 @@
<value> <string encoding="cdata"><![CDATA[ <value> <string encoding="cdata"><![CDATA[
from DateTime import DateTime\n from DateTime import DateTime\n
from Products.ZSQLCatalog.SQLCatalog import SimpleQuery\n
\n \n
# params\n # params\n
section_title = \'My Organisation\'\n section_title = \'My Organisation\'\n
...@@ -90,7 +91,7 @@ if 1:\n ...@@ -90,7 +91,7 @@ if 1:\n
def getAccountByTitle(title):\n def getAccountByTitle(title):\n
account_list = [x.getObject().getRelativeUrl() for x in\n account_list = [x.getObject().getRelativeUrl() for x in\n
portal.portal_catalog(portal_type=\'Account\',\n portal.portal_catalog(portal_type=\'Account\',\n
title=title)]\n title=SimpleQuery(title=title, comparison_operator=\'=\'))]\n
assert len(account_list) == 1, \\\n assert len(account_list) == 1, \\\n
\'%d account with title "%s"\' % (len(account_list), title)\n \'%d account with title "%s"\' % (len(account_list), title)\n
return account_list[0]\n return account_list[0]\n
...@@ -98,7 +99,7 @@ def getAccountByTitle(title):\n ...@@ -98,7 +99,7 @@ def getAccountByTitle(title):\n
def getOrganisationByTitle(title):\n def getOrganisationByTitle(title):\n
document_list = [x.getObject().getRelativeUrl() for x in\n document_list = [x.getObject().getRelativeUrl() for x in\n
portal.portal_catalog(portal_type=\'Organisation\',\n portal.portal_catalog(portal_type=\'Organisation\',\n
title=title)]\n title=SimpleQuery(title=title, comparison_operator=\'=\'))]\n
assert len(document_list) == 1, \\\n assert len(document_list) == 1, \\\n
\'%d organisation with title "%s"\' % (len(document_list), title)\n \'%d organisation with title "%s"\' % (len(document_list), title)\n
return document_list[0]\n return document_list[0]\n
...@@ -109,14 +110,14 @@ euro_resource = \'currency_module/euro\'\n ...@@ -109,14 +110,14 @@ euro_resource = \'currency_module/euro\'\n
def getBankAccountByTitle(title):\n def getBankAccountByTitle(title):\n
document_list = [x.getObject().getRelativeUrl() for x in\n document_list = [x.getObject().getRelativeUrl() for x in\n
portal.portal_catalog(portal_type=\'Bank Account\',\n portal.portal_catalog(portal_type=\'Bank Account\',\n
title=title)]\n title=SimpleQuery(title=title, comparison_operator=\'=\'))]\n
assert len(document_list) == 1, \\\n assert len(document_list) == 1, \\\n
\'%d Bank Account with title "%s"\' % (len(document_list), title)\n \'%d Bank Account with title "%s"\' % (len(document_list), title)\n
return document_list[0]\n return document_list[0]\n
\n \n
product_list = [o.getObject() for o in portal.portal_catalog(\n product_list = [o.getObject() for o in portal.portal_catalog(\n
portal_type=\'Product\',\n portal_type=\'Product\',\n
title=\'Dummy Product for testing\')]\n title=SimpleQuery(title=\'Dummy Product for testing\', comparison_operator=\'=\'))]\n
if product_list:\n if product_list:\n
product = product_list[0]\n product = product_list[0]\n
else:\n else:\n
......
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