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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gabriel Monnerat
erp5
Commits
28db3a9c
Commit
28db3a9c
authored
Mar 22, 2012
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testAccountingRules: use XMLMatrix API instead of guessing cell ids
parent
16e7b5d0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
26 deletions
+12
-26
product/ERP5/tests/testAccountingRules.py
product/ERP5/tests/testAccountingRules.py
+12
-26
No files found.
product/ERP5/tests/testAccountingRules.py
View file @
28db3a9c
...
@@ -270,8 +270,6 @@ class TestAccountingRules(TestAccountingRulesMixin, ERP5TypeTestCase):
...
@@ -270,8 +270,6 @@ class TestAccountingRules(TestAccountingRulesMixin, ERP5TypeTestCase):
def
stepUpdateInvoiceTransactionRuleMatrix
(
self
,
sequence
,
**
kw
)
:
def
stepUpdateInvoiceTransactionRuleMatrix
(
self
,
sequence
,
**
kw
)
:
"""Creates/updates the matrix of the sale invoice transaction rule """
"""Creates/updates the matrix of the sale invoice transaction rule """
invoice_transaction_rule
=
sequence
.
get
(
'invoice_transaction_rule'
)
invoice_transaction_rule
=
sequence
.
get
(
'invoice_transaction_rule'
)
base_id
=
'movement'
kwd
=
{
'base_id'
:
base_id
}
# update the matrix, generates the accounting rule cells
# update the matrix, generates the accounting rule cells
invoice_transaction_rule
.
edit
()
invoice_transaction_rule
.
edit
()
...
@@ -280,31 +278,19 @@ class TestAccountingRules(TestAccountingRulesMixin, ERP5TypeTestCase):
...
@@ -280,31 +278,19 @@ class TestAccountingRules(TestAccountingRulesMixin, ERP5TypeTestCase):
# check the accounting rule cells inside the matrix
# check the accounting rule cells inside the matrix
cell_list
=
invoice_transaction_rule
.
contentValues
(
cell_list
=
invoice_transaction_rule
.
contentValues
(
filter
=
{
'portal_type'
:
self
.
accounting_rule_cell_portal_type
})
portal_type
=
self
.
accounting_rule_cell_portal_type
)
self
.
assertEqual
(
len
(
cell_list
),
4
)
kw
=
dict
(
product_notebook_region_france_cell
=
invoice_transaction_rule
.
getCell
(
# In the matrix, cells are named on the scheme :
'product_notebook'
,
'region_france'
,
base_id
=
'movement'
),
# ${base_id} + '_'.join(predicate_dimension ordered by int_index)
product_notebook_region_africa_cell
=
invoice_transaction_rule
.
getCell
(
product_notebook_region_france_cell
=
getattr
(
invoice_transaction_rule
,
'product_notebook'
,
'region_africa'
,
base_id
=
'movement'
),
'%s_0_0'
%
base_id
,
None
)
product_barebone_region_france_cell
=
invoice_transaction_rule
.
getCell
(
product_notebook_region_africa_cell
=
getattr
(
invoice_transaction_rule
,
'product_barebone'
,
'region_france'
,
base_id
=
'movement'
),
'%s_0_1'
%
base_id
,
None
)
product_barebone_region_africa_cell
=
invoice_transaction_rule
.
getCell
(
product_barebone_region_france_cell
=
getattr
(
invoice_transaction_rule
,
'product_barebone'
,
'region_africa'
,
base_id
=
'movement'
),
'%s_1_0'
%
base_id
,
None
)
product_barebone_region_africa_cell
=
getattr
(
invoice_transaction_rule
,
'%s_1_1'
%
base_id
,
None
)
self
.
failUnless
(
product_notebook_region_france_cell
!=
None
)
self
.
failUnless
(
product_notebook_region_africa_cell
!=
None
)
self
.
failUnless
(
product_barebone_region_france_cell
!=
None
)
self
.
failUnless
(
product_barebone_region_africa_cell
!=
None
)
sequence
.
edit
(
product_notebook_region_france_cell
=
product_notebook_region_france_cell
,
product_notebook_region_africa_cell
=
product_notebook_region_africa_cell
,
product_barebone_region_france_cell
=
product_barebone_region_france_cell
,
product_barebone_region_africa_cell
=
product_barebone_region_africa_cell
,
)
)
self
.
assertSameSet
(
cell_list
,
kw
.
values
())
sequence
.
edit
(
**
kw
)
def
stepValidateInvoiceTransaction
(
self
,
sequence
,
**
kw
)
:
def
stepValidateInvoiceTransaction
(
self
,
sequence
,
**
kw
)
:
"""validates the sale invoice transaction rule"""
"""validates the sale invoice transaction rule"""
...
...
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