Commit d01de179 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

test: modify functional test for recent full text catalog.

parent b72e16ed
...@@ -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
...@@ -80,7 +81,7 @@ if 1:\n ...@@ -80,7 +81,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
...@@ -88,7 +89,7 @@ def getAccountByTitle(title):\n ...@@ -88,7 +89,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
...@@ -106,7 +107,7 @@ euro_resource = getCurrencyByReference(\'EUR\')\n ...@@ -106,7 +107,7 @@ euro_resource = getCurrencyByReference(\'EUR\')\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=\'Dummy Product for testing\', 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
......
...@@ -58,6 +58,7 @@ business_process = \'business_process_module/erp5_default_business_process\'\n ...@@ -58,6 +58,7 @@ business_process = \'business_process_module/erp5_default_business_process\'\n
portal = context.getPortalObject()\n portal = context.getPortalObject()\n
accounting_module = portal.accounting_module\n accounting_module = portal.accounting_module\n
from DateTime import DateTime\n from DateTime import DateTime\n
from Products.ZSQLCatalog.SQLCatalog import SimpleQuery\n
year = 2005\n year = 2005\n
\n \n
# if the previous test didn\'t change input data, no need to recreate content\n # if the previous test didn\'t change input data, no need to recreate content\n
...@@ -82,7 +83,7 @@ if 1:\n ...@@ -82,7 +83,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
...@@ -90,7 +91,7 @@ def getAccountByTitle(title):\n ...@@ -90,7 +91,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
...@@ -99,7 +100,7 @@ section = getOrganisationByTitle(section_title)\n ...@@ -99,7 +100,7 @@ section = getOrganisationByTitle(section_title)\n
def getPersonByTitle(title):\n def getPersonByTitle(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=\'Person\',\n portal.portal_catalog(portal_type=\'Person\',\n
title=title)]\n title=SimpleQuery(title=title, comparison_operator=\'=\'))]\n
assert len(document_list) == 1, \\\n assert len(document_list) == 1, \\\n
\'%d person with title "%s"\' % (len(document_list), title)\n \'%d person with title "%s"\' % (len(document_list), title)\n
return document_list[0]\n return document_list[0]\n
...@@ -116,7 +117,7 @@ euro_resource = getCurrencyByReference(\'EUR\')\n ...@@ -116,7 +117,7 @@ euro_resource = getCurrencyByReference(\'EUR\')\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
......
...@@ -129,7 +129,7 @@ stool.setSelectionColumns(\'account_module_selection\',\n ...@@ -129,7 +129,7 @@ stool.setSelectionColumns(\'account_module_selection\',\n
\n \n
# delete the "dummy account" we create in test_account_gap_parallel_list_field\n # delete the "dummy account" we create in test_account_gap_parallel_list_field\n
dummy_account_list = portal.account_module.searchFolder(\n dummy_account_list = portal.account_module.searchFolder(\n
title=\'Dummy Account for UI Test\')\n title=\'=Dummy Account for UI Test\')\n
if dummy_account_list:\n if dummy_account_list:\n
portal.account_module.manage_delObjects([dummy_account_list[0].getId()])\n portal.account_module.manage_delObjects([dummy_account_list[0].getId()])\n
\n \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