Commit baecf725 authored by Jérome Perrin's avatar Jérome Perrin

It makes no sense to define a sort order in the matrix, this feature is therefore removed.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@5119 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a5cb5954
...@@ -1796,59 +1796,6 @@ class TestAccountingRules(ERP5TypeTestCase): ...@@ -1796,59 +1796,6 @@ class TestAccountingRules(ERP5TypeTestCase):
# quantity from sum of receivable movement # quantity from sum of receivable movement
# link to sale invoice # link to sale invoice
def test_08_GetMatchingCellIntIndex(self, quiet=0, run=RUN_ALL_TESTS):
""" Int index order in getMatchingCell.
When defining a matrix rule, predicates must be tested in the order
defined by 'int_index' property on those predicates.
"""
if not run:
return
if not quiet:
message = 'Int index order in getMatchingCell'
ZopeTestCase._print('\n%s ' % message)
LOG('Testing... ', INFO, message)
# create a matrix
# 1a 2b
# 1x a*x b*x
# 2y a*y b*y
rule = self.getPortal().portal_rules.newContent(
portal_type = self.invoice_transaction_rule_portal_type)
predicate_1a = rule.newContent(
portal_type = self.predicate_portal_type,
string_index = "product",
id = "1a",
int_index = 1)
predicate_2b = rule.newContent(
portal_type = self.predicate_portal_type,
string_index = "product",
id = "2b",
int_index = 2)
predicate_1x = rule.newContent(
portal_type = self.predicate_portal_type,
string_index = "region",
id = "1x",
int_index = 1)
predicate_2y = rule.newContent(
portal_type = self.predicate_portal_type,
string_index = "region",
id = "2y",
int_index = 2)
get_transaction().commit()
self.tic()
rule.updateMatrix()
# make sure predicates are checked in the right order
previous_priority = -100
for key_list in rule._getSortedCellKeyList():
priority = 0
for index, path in enumerate(key_list) :
priority += self.getPortal().restrictedTraverse(path).getIntIndex()
self.assert_( previous_priority <= priority,
"%s <= %s" % (previous_priority, priority))
previous_priority = priority
if __name__ == '__main__': if __name__ == '__main__':
framework() framework()
else: else:
......
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