Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5_fork
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Eteri
erp5_fork
Commits
6c0b47e6
Commit
6c0b47e6
authored
Oct 14, 2015
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
accounting : tests for AccountingTransaction_getListBoxColumnList
parent
c1770ec7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
97 additions
and
0 deletions
+97
-0
product/ERP5/tests/testAccounting.py
product/ERP5/tests/testAccounting.py
+97
-0
No files found.
product/ERP5/tests/testAccounting.py
View file @
6c0b47e6
...
...
@@ -3549,6 +3549,103 @@ class TestTransactions(AccountingTestCase):
organisation1
.
getRelativeUrl
())],
self
.
portal
.
Account_getDestinationSectionItemList
())
def
test_AccountingTransaction_getListBoxColumnList_does_not_enable_section_column_when_only_two_sections
(
self
):
# AccountingTransaction_getListBoxColumnList is the script returning the
# columns to display in AccountingTransaction_view.
at
=
self
.
_makeOne
(
portal_type
=
'Accounting Transaction'
,
source_section_value
=
self
.
section
,
destination_section_value
=
self
.
organisation_module
.
client_1
,
lines
=
(
dict
(
source_value
=
self
.
account_module
.
goods_purchase
,
source_debit
=
500
),
dict
(
source_value
=
self
.
account_module
.
receivable
,
source_credit
=
500
)))
self
.
assertNotIn
(
(
'getDestinationSectionTitle'
,
'Third Party'
),
at
.
AccountingTransaction_getListBoxColumnList
(
source
=
True
))
self
.
assertNotIn
(
(
'getSourceSectionTitle'
,
'Third Party'
),
at
.
AccountingTransaction_getListBoxColumnList
(
source
=
False
))
def
test_AccountingTransaction_getListBoxColumnList_enables_destination_section_column_when_more_than_two_sections
(
self
):
# AccountingTransaction_getListBoxColumnList is the script returning the
# columns to display in AccountingTransaction_view.
at
=
self
.
_makeOne
(
portal_type
=
'Accounting Transaction'
,
source_section_value
=
self
.
section
,
destination_section_value
=
self
.
organisation_module
.
client_1
,
lines
=
(
dict
(
source_value
=
self
.
account_module
.
goods_purchase
,
source_debit
=
500
),
dict
(
source_value
=
self
.
account_module
.
receivable
,
destination_section_value
=
self
.
organisation_module
.
client_2
,
source_credit
=
500
)))
# Only the source view have one extra column, because from destination point
# of view, there is only one mirror section
self
.
assertIn
(
(
'getDestinationSectionTitle'
,
'Third Party'
),
at
.
AccountingTransaction_getListBoxColumnList
(
source
=
True
))
self
.
assertNotIn
(
(
'getSourceSectionTitle'
,
'Third Party'
),
at
.
AccountingTransaction_getListBoxColumnList
(
source
=
False
))
def
test_AccountingTransaction_getListBoxColumnList_enables_source_section_column_when_more_than_two_sections
(
self
):
at
=
self
.
_makeOne
(
portal_type
=
'Accounting Transaction'
,
destination_section_value
=
self
.
section
,
source_section_value
=
self
.
organisation_module
.
client_1
,
lines
=
(
dict
(
destination_value
=
self
.
account_module
.
goods_purchase
,
destination_debit
=
500
),
dict
(
destination_value
=
self
.
account_module
.
receivable
,
source_section_value
=
self
.
organisation_module
.
client_2
,
destination_credit
=
500
)))
# Only the destination view have one extra column, because from source point
# of view, there is only one mirror section
self
.
assertNotIn
(
(
'getDestinationSectionTitle'
,
'Third Party'
),
at
.
AccountingTransaction_getListBoxColumnList
(
source
=
True
))
self
.
assertIn
(
(
'getSourceSectionTitle'
,
'Third Party'
),
at
.
AccountingTransaction_getListBoxColumnList
(
source
=
False
))
def
test_AccountingTransaction_getListBoxColumnList_enables_source_section_column_when_same_section_both_sides
(
self
):
# Edge case, source section from the transaction is also used as destination section on a line
# does not make much sense, but have to be visible when looking at transaction
at
=
self
.
_makeOne
(
portal_type
=
'Accounting Transaction'
,
source_section_value
=
self
.
section
,
destination_section_value
=
self
.
organisation_module
.
client_1
,
lines
=
(
dict
(
source_value
=
self
.
account_module
.
goods_purchase
,
source_debit
=
500
),
dict
(
source_value
=
self
.
account_module
.
receivable
,
destination_section_value
=
self
.
section
,
# Source section is also destination section here
source_credit
=
500
)))
self
.
assertIn
(
(
'getDestinationSectionTitle'
,
'Third Party'
),
at
.
AccountingTransaction_getListBoxColumnList
(
source
=
True
))
self
.
assertNotIn
(
(
'getSourceSectionTitle'
,
'Third Party'
),
at
.
AccountingTransaction_getListBoxColumnList
(
source
=
False
))
def
test_AccountingTransaction_getListBoxColumnList_enables_destination_section_column_when_same_section_both_sides
(
self
):
# Edge case, destination section from the transaction is also used as source section on a line
# does not make much sense, but have to be visible when looking at transaction
at
=
self
.
_makeOne
(
portal_type
=
'Accounting Transaction'
,
destination_section_value
=
self
.
section
,
source_section_value
=
self
.
organisation_module
.
client_1
,
lines
=
(
dict
(
destination_value
=
self
.
account_module
.
goods_purchase
,
destination_debit
=
500
),
dict
(
destination_value
=
self
.
account_module
.
receivable
,
source_section_value
=
self
.
section
,
# Destination section is also here section here
destination_credit
=
500
)))
self
.
assertNotIn
(
(
'getDestinationSectionTitle'
,
'Third Party'
),
at
.
AccountingTransaction_getListBoxColumnList
(
source
=
True
))
self
.
assertIn
(
(
'getSourceSectionTitle'
,
'Third Party'
),
at
.
AccountingTransaction_getListBoxColumnList
(
source
=
False
))
class
TestAccountingWithSequences
(
ERP5TypeTestCase
):
"""The first test for Accounting
"""
...
...
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