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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Bryan Kaperick
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):
def
stepUpdateInvoiceTransactionRuleMatrix
(
self
,
sequence
,
**
kw
)
:
"""Creates/updates the matrix of the sale 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
invoice_transaction_rule
.
edit
()
...
...
@@ -280,31 +278,19 @@ class TestAccountingRules(TestAccountingRulesMixin, ERP5TypeTestCase):
# check the accounting rule cells inside the matrix
cell_list
=
invoice_transaction_rule
.
contentValues
(
filter
=
{
'portal_type'
:
self
.
accounting_rule_cell_portal_type
})
self
.
assertEqual
(
len
(
cell_list
),
4
)
# In the matrix, cells are named on the scheme :
# ${base_id} + '_'.join(predicate_dimension ordered by int_index)
product_notebook_region_france_cell
=
getattr
(
invoice_transaction_rule
,
'%s_0_0'
%
base_id
,
None
)
product_notebook_region_africa_cell
=
getattr
(
invoice_transaction_rule
,
'%s_0_1'
%
base_id
,
None
)
product_barebone_region_france_cell
=
getattr
(
invoice_transaction_rule
,
'%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
,
portal_type
=
self
.
accounting_rule_cell_portal_type
)
kw
=
dict
(
product_notebook_region_france_cell
=
invoice_transaction_rule
.
getCell
(
'product_notebook'
,
'region_france'
,
base_id
=
'movement'
),
product_notebook_region_africa_cell
=
invoice_transaction_rule
.
getCell
(
'product_notebook'
,
'region_africa'
,
base_id
=
'movement'
),
product_barebone_region_france_cell
=
invoice_transaction_rule
.
getCell
(
'product_barebone'
,
'region_france'
,
base_id
=
'movement'
),
product_barebone_region_africa_cell
=
invoice_transaction_rule
.
getCell
(
'product_barebone'
,
'region_africa'
,
base_id
=
'movement'
),
)
self
.
assertSameSet
(
cell_list
,
kw
.
values
())
sequence
.
edit
(
**
kw
)
def
stepValidateInvoiceTransaction
(
self
,
sequence
,
**
kw
)
:
"""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