Commit c8f10b4e authored by Yusei Tahara's avatar Yusei Tahara

Fixed tests.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17665 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 46b49602
...@@ -497,15 +497,20 @@ class TestPredicates(ERP5TypeTestCase): ...@@ -497,15 +497,20 @@ class TestPredicates(ERP5TypeTestCase):
""" """
if not run : return if not run : return
def test(function):
"""make sure that an exception is not raised"""
function()
return True
predicate_without_membership_values = self.createPredicate( predicate_without_membership_values = self.createPredicate(
membership_criterion_base_category_list=['group']) membership_criterion_base_category_list=['group'])
self.assert_(predicate_without_membership_values.searchResults()) self.assert_(test(predicate_without_membership_values.searchResults))
predicate_with_membership_values = self.createPredicate( predicate_with_membership_values = self.createPredicate(
membership_criterion_base_category_list=['group'], membership_criterion_base_category_list=['group'],
membership_criterion_category_list=GROUP_STOREVER_PATH, membership_criterion_category_list=GROUP_STOREVER_PATH,
) )
self.assert_(predicate_with_membership_values.searchResults()) self.assert_(test(predicate_with_membership_values.searchResults))
def test_MultiValuedMembershipCriterion_SQLQuery(self, quiet=QUIET, run=RUN_ALL_TESTS): def test_MultiValuedMembershipCriterion_SQLQuery(self, quiet=QUIET, run=RUN_ALL_TESTS):
""" """
...@@ -513,15 +518,20 @@ class TestPredicates(ERP5TypeTestCase): ...@@ -513,15 +518,20 @@ class TestPredicates(ERP5TypeTestCase):
""" """
if not run : return if not run : return
def test(function):
"""make sure that an exception is not raised"""
function()
return True
predicate_without_membership_values = self.createPredicate( predicate_without_membership_values = self.createPredicate(
multimembership_criterion_base_category_list=['group']) multimembership_criterion_base_category_list=['group'])
self.assert_(predicate_without_membership_values.searchResults()) self.assert_(test(predicate_without_membership_values.searchResults))
predicate_with_membership_values = self.createPredicate( predicate_with_membership_values = self.createPredicate(
multimembership_criterion_base_category_list=['group'], multimembership_criterion_base_category_list=['group'],
membership_criterion_category_list=GROUP_STOREVER_PATH, membership_criterion_category_list=GROUP_STOREVER_PATH,
) )
self.assert_(predicate_with_membership_values.searchResults()) self.assert_(test(predicate_with_membership_values.searchResults))
# TODO : # TODO :
# multi membership category # multi membership category
......
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