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
Lukas Niegsch
erp5
Commits
b6ccfc26
Commit
b6ccfc26
authored
Sep 04, 2020
by
Arnaud Fontaine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ZODB Components: erp5_accounting: Migrate Unit Tests.
parent
719b21e3
Changes
19
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
977 additions
and
169 deletions
+977
-169
bt5/erp5_accounting/TestTemplateItem/portal_components/test.erp5.testAccounting.py
...emplateItem/portal_components/test.erp5.testAccounting.py
+56
-59
bt5/erp5_accounting/TestTemplateItem/portal_components/test.erp5.testAccounting.xml
...mplateItem/portal_components/test.erp5.testAccounting.xml
+110
-0
bt5/erp5_accounting/TestTemplateItem/portal_components/test.erp5.testAccountingReports.py
...Item/portal_components/test.erp5.testAccountingReports.py
+24
-38
bt5/erp5_accounting/TestTemplateItem/portal_components/test.erp5.testAccountingReports.xml
...tem/portal_components/test.erp5.testAccountingReports.xml
+110
-0
bt5/erp5_accounting/TestTemplateItem/portal_components/test.erp5.testTypeDefinition.py
...ateItem/portal_components/test.erp5.testTypeDefinition.py
+132
-0
bt5/erp5_accounting/TestTemplateItem/portal_components/test.erp5.testTypeDefinition.xml
...teItem/portal_components/test.erp5.testTypeDefinition.xml
+110
-0
bt5/erp5_accounting/bt/template_test_id_list
bt5/erp5_accounting/bt/template_test_id_list
+3
-0
bt5/erp5_accounting/bt/test_dependency_list
bt5/erp5_accounting/bt/test_dependency_list
+15
-0
bt5/erp5_accounting_l10n_fr/TestTemplateItem/portal_components/test.erp5.testAccounting_l10n_fr.py
...tem/portal_components/test.erp5.testAccounting_l10n_fr.py
+12
-10
bt5/erp5_accounting_l10n_fr/TestTemplateItem/portal_components/test.erp5.testAccounting_l10n_fr.xml
...em/portal_components/test.erp5.testAccounting_l10n_fr.xml
+110
-0
bt5/erp5_accounting_l10n_fr/bt/template_test_id_list
bt5/erp5_accounting_l10n_fr/bt/template_test_id_list
+1
-0
bt5/erp5_accounting_l10n_fr/bt/test_dependency_list
bt5/erp5_accounting_l10n_fr/bt/test_dependency_list
+15
-0
bt5/erp5_accounting_ui_test/TestTemplateItem/portal_components/test.erp5.testConversionInSimulation.py
...portal_components/test.erp5.testConversionInSimulation.py
+40
-40
bt5/erp5_accounting_ui_test/TestTemplateItem/portal_components/test.erp5.testConversionInSimulation.xml
...ortal_components/test.erp5.testConversionInSimulation.xml
+110
-0
bt5/erp5_accounting_ui_test/TestTemplateItem/portal_components/test.erp5.testERP5CurrencyExchangeLine.py
...rtal_components/test.erp5.testERP5CurrencyExchangeLine.py
+7
-20
bt5/erp5_accounting_ui_test/TestTemplateItem/portal_components/test.erp5.testERP5CurrencyExchangeLine.xml
...tal_components/test.erp5.testERP5CurrencyExchangeLine.xml
+110
-0
bt5/erp5_accounting_ui_test/bt/template_test_id_list
bt5/erp5_accounting_ui_test/bt/template_test_id_list
+2
-0
bt5/erp5_accounting_ui_test/bt/test_dependency_list
bt5/erp5_accounting_ui_test/bt/test_dependency_list
+9
-1
bt5/erp5_bank_reconciliation/TestTemplateItem/portal_components/test.erp5.testBankReconciliation.py
...tem/portal_components/test.erp5.testBankReconciliation.py
+1
-1
No files found.
product/ERP5/tests/
testAccounting.py
→
bt5/erp5_accounting/TestTemplateItem/portal_components/test.erp5.
testAccounting.py
View file @
b6ccfc26
This diff is collapsed.
Click to expand it.
bt5/erp5_accounting/TestTemplateItem/portal_components/test.erp5.testAccounting.xml
0 → 100644
View file @
b6ccfc26
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Test Component"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
testAccounting
</string>
</value>
</item>
<item>
<key>
<string>
default_source_reference
</string>
</key>
<value>
<string>
Products.ERP5.tests.testAccounting
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
test.erp5.testAccounting
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Test Component
</string>
</value>
</item>
<item>
<key>
<string>
sid
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
text_content_error_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
erp5
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
product/ERP5/tests/
testAccountingReports.py
→
bt5/erp5_accounting/TestTemplateItem/portal_components/test.erp5.
testAccountingReports.py
View file @
b6ccfc26
This diff is collapsed.
Click to expand it.
bt5/erp5_accounting/TestTemplateItem/portal_components/test.erp5.testAccountingReports.xml
0 → 100644
View file @
b6ccfc26
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Test Component"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
testAccountingReports
</string>
</value>
</item>
<item>
<key>
<string>
default_source_reference
</string>
</key>
<value>
<string>
Products.ERP5.tests.testAccountingReports
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
test.erp5.testAccountingReports
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Test Component
</string>
</value>
</item>
<item>
<key>
<string>
sid
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
text_content_error_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
erp5
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_accounting/TestTemplateItem/portal_components/test.erp5.testTypeDefinition.py
0 → 100644
View file @
b6ccfc26
##############################################################################
# Copyright (c) 2016 Nexedi SARL and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
Products.ERP5Type.UnrestrictedMethod
import
UnrestrictedMethod
class
PortalTypeOfPortalTypeTestCase
(
ERP5TypeTestCase
):
"""
Base class to test Portal Types of other Portal Types
"""
def
getBusinessTemplateList
(
self
):
return
(
'erp5_core'
,
'erp5_base'
,
'erp5_simulation'
,
'erp5_accounting'
)
def
setUpPropertyOnPortalType
(
self
,
portal_type_id
,
property_name
,
property_value
):
portal_type
=
self
.
portal
.
portal_types
.
get
(
portal_type_id
,
None
)
portal_type
.
setProperty
(
property_name
,
property_value
)
def
cleanPropertyOnPortalType
(
self
,
portal_type_id
,
property_name
):
portal_type
=
self
.
portal
.
portal_types
.
get
(
portal_type_id
,
None
)
portal_type
.
setProperty
(
property_name
,
None
)
class
TestDeliveryTypeInformation
(
PortalTypeOfPortalTypeTestCase
):
"""
Delivery Type is a Base Type on which a list of allowed ledgers is defined.
This suite checks that its custom features are correctly implemented.
"""
def
afterSetUp
(
self
):
self
.
createLedgerCategory
()
@
UnrestrictedMethod
def
createLedgerCategory
(
self
):
portal_categories
=
self
.
portal
.
portal_categories
ledger
=
self
.
portal
.
portal_categories
.
get
(
'ledger'
,
None
)
if
ledger
is
None
:
ledger
=
portal_categories
.
newContent
(
portal_type
=
'Base Category'
,
id
=
'ledger'
)
accounting_ledger
=
ledger
.
get
(
'accounting'
,
None
)
if
accounting_ledger
is
None
:
accounting_ledger
=
ledger
.
newContent
(
portal_type
=
'Category'
,
id
=
'accounting'
)
if
accounting_ledger
.
get
(
'general'
,
None
)
is
None
:
accounting_ledger
.
newContent
(
portal_type
=
'Category'
,
id
=
'general'
)
if
accounting_ledger
.
get
(
'detailed'
,
None
)
is
None
:
accounting_ledger
.
newContent
(
portal_type
=
'Category'
,
id
=
'detailed'
)
def
testDefaultLedgerIsSetOnObjectIfSetOnPortalType
(
self
):
"""
Sets up a list of ledger on the Accounting Transaction portal type,
which is a DeliveryTypeInformation, and checks that new Accounting Transactions
have a default ledger set at their creation
"""
portal_type
=
"Accounting Transaction"
self
.
setUpPropertyOnPortalType
(
portal_type
,
"ledger_list"
,
[
'accounting/general'
,
'accounting/detailed'
])
self
.
assertEqual
(
self
.
portal
.
portal_types
.
get
(
portal_type
).
getDefaultLedger
(),
'accounting/general'
)
module
=
self
.
portal
.
getDefaultModule
(
portal_type
)
accounting_transaction
=
module
.
newContent
(
portal_type
=
portal_type
)
self
.
assertEqual
(
accounting_transaction
.
hasLedger
(),
True
)
self
.
assertEqual
(
accounting_transaction
.
getLedgerList
(),
[
'accounting/general'
])
def
testDefaultLedgerIsNotSetOnObjectIfNotSetOnPortalType
(
self
):
"""
If no ledger is defined on the portal type, then it means the
"allowed ledger list" feature is not in use in this instance
"""
portal_type
=
"Accounting Transaction"
portal_type_object
=
self
.
portal
.
portal_types
.
get
(
portal_type
)
self
.
cleanPropertyOnPortalType
(
portal_type
,
'ledger'
)
# No ledger should be set on the portal type
self
.
assertEqual
(
portal_type_object
.
getLedgerList
(),
[])
module
=
self
.
portal
.
getDefaultModule
(
portal_type
)
accounting_transaction
=
module
.
newContent
(
portal_type
=
portal_type
)
self
.
assertEqual
(
accounting_transaction
.
getLedgerList
(),
[])
def
testDefaultLedgerIsOverwrittenByNewContentParameter
(
self
):
"""
If a Delivery is created with a given ledger, then it should overwrite
the default ledger
"""
portal_type
=
"Accounting Transaction"
self
.
setUpPropertyOnPortalType
(
portal_type
,
"ledger_list"
,
[
'accounting/general'
,
'accounting/detailed'
])
self
.
assertEqual
(
self
.
portal
.
portal_types
.
get
(
portal_type
).
getDefaultLedger
(),
'accounting/general'
)
module
=
self
.
portal
.
getDefaultModule
(
portal_type
)
accounting_transaction
=
module
.
newContent
(
portal_type
=
portal_type
,
ledger
=
'accounting/detailed'
)
self
.
assertEqual
(
accounting_transaction
.
hasLedger
(),
True
)
self
.
assertEqual
(
accounting_transaction
.
getLedgerList
(),
[
'accounting/detailed'
])
bt5/erp5_accounting/TestTemplateItem/portal_components/test.erp5.testTypeDefinition.xml
0 → 100644
View file @
b6ccfc26
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Test Component"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
testTypeDefinition
</string>
</value>
</item>
<item>
<key>
<string>
default_source_reference
</string>
</key>
<value>
<string>
Products.ERP5Type.tests.testTypeDefinition
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
test.erp5.testTypeDefinition
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Test Component
</string>
</value>
</item>
<item>
<key>
<string>
sid
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
text_content_error_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
erp5
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_accounting/bt/template_test_id_list
0 → 100644
View file @
b6ccfc26
test.erp5.testAccounting
test.erp5.testAccountingReports
test.erp5.testTypeDefinition
\ No newline at end of file
bt5/erp5_accounting/bt/test_dependency_list
0 → 100644
View file @
b6ccfc26
erp5_full_text_mroonga_catalog
erp5_core_proxy_field_legacy
erp5_base
erp5_pdm
erp5_simulation
erp5_trade
erp5_project
erp5_ods_style
erp5_configurator_standard_trade_template
erp5_invoicing
erp5_configurator_standard_accounting_template
erp5_configurator_standard_invoicing_template
erp5_simulation_test
erp5_accounting_ui_test
erp5_simplified_invoicing
\ No newline at end of file
product/ERP5/tests/
testAccounting_l10n_fr.py
→
bt5/erp5_accounting_l10n_fr/TestTemplateItem/portal_components/test.erp5.
testAccounting_l10n_fr.py
View file @
b6ccfc26
...
@@ -40,7 +40,7 @@ from DateTime import DateTime
...
@@ -40,7 +40,7 @@ from DateTime import DateTime
from
lxml
import
etree
from
lxml
import
etree
from
AccessControl.SecurityManagement
import
newSecurityManager
from
AccessControl.SecurityManagement
import
newSecurityManager
from
Products.ERP5.tests
.testAccounting
import
AccountingTestCase
from
erp5.component.test
.testAccounting
import
AccountingTestCase
class
TestAccounting_l10n_fr
(
AccountingTestCase
):
class
TestAccounting_l10n_fr
(
AccountingTestCase
):
"""Test Accounting L10N FR
"""Test Accounting L10N FR
...
@@ -92,7 +92,7 @@ class TestAccounting_l10n_fr(AccountingTestCase):
...
@@ -92,7 +92,7 @@ class TestAccounting_l10n_fr(AccountingTestCase):
def
test_FEC
(
self
):
def
test_FEC
(
self
):
account_module
=
self
.
portal
.
account_module
account_module
=
self
.
portal
.
account_module
first
=
self
.
_makeOne
(
self
.
_makeOne
(
portal_type
=
'Purchase Invoice Transaction'
,
portal_type
=
'Purchase Invoice Transaction'
,
title
=
'Première Écriture'
,
title
=
'Première Écriture'
,
simulation_state
=
'delivered'
,
simulation_state
=
'delivered'
,
...
@@ -106,7 +106,7 @@ class TestAccounting_l10n_fr(AccountingTestCase):
...
@@ -106,7 +106,7 @@ class TestAccounting_l10n_fr(AccountingTestCase):
dict
(
destination_value
=
account_module
.
goods_purchase
,
dict
(
destination_value
=
account_module
.
goods_purchase
,
destination_credit
=
110.00
)))
destination_credit
=
110.00
)))
se
cond
=
se
lf
.
_makeOne
(
self
.
_makeOne
(
portal_type
=
'Sale Invoice Transaction'
,
portal_type
=
'Sale Invoice Transaction'
,
title
=
'Seconde Écriture'
,
title
=
'Seconde Écriture'
,
simulation_state
=
'delivered'
,
simulation_state
=
'delivered'
,
...
@@ -130,7 +130,7 @@ class TestAccounting_l10n_fr(AccountingTestCase):
...
@@ -130,7 +130,7 @@ class TestAccounting_l10n_fr(AccountingTestCase):
fec_xml
=
''
fec_xml
=
''
last_message
=
self
.
portal
.
MailHost
.
_last_message
last_message
=
self
.
portal
.
MailHost
.
_last_message
self
.
assertNotEquals
((),
last_message
)
self
.
assertNotEquals
((),
last_message
)
mfrom
,
mto
,
message_text
=
last_message
_
,
mto
,
message_text
=
last_message
self
.
assertEqual
(
'"%s" <%s>'
%
(
self
.
first_name
,
self
.
recipient_email_address
),
mto
[
0
])
self
.
assertEqual
(
'"%s" <%s>'
%
(
self
.
first_name
,
self
.
recipient_email_address
),
mto
[
0
])
mail_message
=
email
.
message_from_string
(
message_text
)
mail_message
=
email
.
message_from_string
(
message_text
)
for
part
in
mail_message
.
walk
():
for
part
in
mail_message
.
walk
():
...
@@ -146,8 +146,9 @@ class TestAccounting_l10n_fr(AccountingTestCase):
...
@@ -146,8 +146,9 @@ class TestAccounting_l10n_fr(AccountingTestCase):
self
.
fail
(
"Attachment not found"
)
self
.
fail
(
"Attachment not found"
)
# validate against official schema
# validate against official schema
import
Products.ERP5.tests
schema
=
etree
.
XMLSchema
(
etree
.
XML
(
open
(
os
.
path
.
join
(
schema
=
etree
.
XMLSchema
(
etree
.
XML
(
open
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'test_data'
,
os
.
path
.
dirname
(
Products
.
ERP5
.
tests
.
__file__
),
'test_data'
,
'formatA47A-I-VII-1.xsd'
)).
read
()))
'formatA47A-I-VII-1.xsd'
)).
read
()))
# this raise if invalid
# this raise if invalid
...
@@ -164,7 +165,7 @@ class TestAccounting_l10n_fr(AccountingTestCase):
...
@@ -164,7 +165,7 @@ class TestAccounting_l10n_fr(AccountingTestCase):
def
_FECWithLedger
(
self
,
ledger_list
=
None
,
group_by
=
None
):
def
_FECWithLedger
(
self
,
ledger_list
=
None
,
group_by
=
None
):
self
.
setUpLedger
()
self
.
setUpLedger
()
account_module
=
self
.
portal
.
account_module
account_module
=
self
.
portal
.
account_module
first
=
self
.
_makeOne
(
self
.
_makeOne
(
portal_type
=
'Purchase Invoice Transaction'
,
portal_type
=
'Purchase Invoice Transaction'
,
title
=
'Première Écriture'
,
title
=
'Première Écriture'
,
simulation_state
=
'delivered'
,
simulation_state
=
'delivered'
,
...
@@ -179,7 +180,7 @@ class TestAccounting_l10n_fr(AccountingTestCase):
...
@@ -179,7 +180,7 @@ class TestAccounting_l10n_fr(AccountingTestCase):
dict
(
destination_value
=
account_module
.
goods_purchase
,
dict
(
destination_value
=
account_module
.
goods_purchase
,
destination_credit
=
110.00
)))
destination_credit
=
110.00
)))
se
cond
=
se
lf
.
_makeOne
(
self
.
_makeOne
(
portal_type
=
'Sale Invoice Transaction'
,
portal_type
=
'Sale Invoice Transaction'
,
title
=
'Seconde Écriture'
,
title
=
'Seconde Écriture'
,
simulation_state
=
'delivered'
,
simulation_state
=
'delivered'
,
...
@@ -194,7 +195,7 @@ class TestAccounting_l10n_fr(AccountingTestCase):
...
@@ -194,7 +195,7 @@ class TestAccounting_l10n_fr(AccountingTestCase):
dict
(
source_value
=
account_module
.
goods_sales
,
dict
(
source_value
=
account_module
.
goods_sales
,
source_credit
=
200.00
)))
source_credit
=
200.00
)))
third
=
self
.
_makeOne
(
self
.
_makeOne
(
portal_type
=
'Sale Invoice Transaction'
,
portal_type
=
'Sale Invoice Transaction'
,
title
=
'Troisième Écriture'
,
title
=
'Troisième Écriture'
,
simulation_state
=
'delivered'
,
simulation_state
=
'delivered'
,
...
@@ -222,7 +223,7 @@ class TestAccounting_l10n_fr(AccountingTestCase):
...
@@ -222,7 +223,7 @@ class TestAccounting_l10n_fr(AccountingTestCase):
fec_xml
=
''
fec_xml
=
''
last_message
=
self
.
portal
.
MailHost
.
_last_message
last_message
=
self
.
portal
.
MailHost
.
_last_message
self
.
assertNotEquals
((),
last_message
)
self
.
assertNotEquals
((),
last_message
)
mfrom
,
mto
,
message_text
=
last_message
_
,
mto
,
message_text
=
last_message
self
.
assertEqual
(
'"%s" <%s>'
%
(
self
.
first_name
,
self
.
recipient_email_address
),
mto
[
0
])
self
.
assertEqual
(
'"%s" <%s>'
%
(
self
.
first_name
,
self
.
recipient_email_address
),
mto
[
0
])
mail_message
=
email
.
message_from_string
(
message_text
)
mail_message
=
email
.
message_from_string
(
message_text
)
for
part
in
mail_message
.
walk
():
for
part
in
mail_message
.
walk
():
...
@@ -238,8 +239,9 @@ class TestAccounting_l10n_fr(AccountingTestCase):
...
@@ -238,8 +239,9 @@ class TestAccounting_l10n_fr(AccountingTestCase):
self
.
fail
(
"Attachment not found"
)
self
.
fail
(
"Attachment not found"
)
# validate against official schema
# validate against official schema
import
Products.ERP5.tests
schema
=
etree
.
XMLSchema
(
etree
.
XML
(
open
(
os
.
path
.
join
(
schema
=
etree
.
XMLSchema
(
etree
.
XML
(
open
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'test_data'
,
os
.
path
.
dirname
(
Products
.
ERP5
.
tests
.
__file__
),
'test_data'
,
'formatA47A-I-VII-1.xsd'
)).
read
()))
'formatA47A-I-VII-1.xsd'
)).
read
()))
# this raise if invalid
# this raise if invalid
...
...
bt5/erp5_accounting_l10n_fr/TestTemplateItem/portal_components/test.erp5.testAccounting_l10n_fr.xml
0 → 100644
View file @
b6ccfc26
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Test Component"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
testAccounting_l10n_fr
</string>
</value>
</item>
<item>
<key>
<string>
default_source_reference
</string>
</key>
<value>
<string>
Products.ERP5.tests.testAccounting_l10n_fr
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
test.erp5.testAccounting_l10n_fr
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Test Component
</string>
</value>
</item>
<item>
<key>
<string>
sid
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
text_content_error_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
erp5
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_accounting_l10n_fr/bt/template_test_id_list
0 → 100644
View file @
b6ccfc26
test.erp5.testAccounting_l10n_fr
\ No newline at end of file
bt5/erp5_accounting_l10n_fr/bt/test_dependency_list
0 → 100644
View file @
b6ccfc26
erp5_full_text_mroonga_catalog
erp5_core_proxy_field_legacy
erp5_base
erp5_pdm
erp5_simulation
erp5_trade
erp5_project
erp5_ods_style
erp5_configurator_standard_trade_template
erp5_invoicing
erp5_configurator_standard_accounting_template
erp5_configurator_standard_invoicing_template
erp5_simulation_test
erp5_accounting_ui_test
erp5_deferred_style
\ No newline at end of file
product/ERP5/tests/
testConversionInSimulation.py
→
bt5/erp5_accounting_ui_test/TestTemplateItem/portal_components/test.erp5.
testConversionInSimulation.py
View file @
b6ccfc26
...
@@ -31,7 +31,7 @@ import unittest
...
@@ -31,7 +31,7 @@ import unittest
from
DateTime
import
DateTime
from
DateTime
import
DateTime
from
zLOG
import
LOG
from
zLOG
import
LOG
from
Testing
import
ZopeTestCase
from
Testing
import
ZopeTestCase
from
Products.ERP5.tests
.testAccounting
import
AccountingTestCase
from
erp5.component.test
.testAccounting
import
AccountingTestCase
from
AccessControl.SecurityManagement
import
newSecurityManager
from
AccessControl.SecurityManagement
import
newSecurityManager
QUIET
=
False
QUIET
=
False
run_all_test
=
True
run_all_test
=
True
...
@@ -80,11 +80,11 @@ class TestConversionInSimulation(AccountingTestCase):
...
@@ -80,11 +80,11 @@ class TestConversionInSimulation(AccountingTestCase):
def
createCategoriesInCategory
(
self
,
category
,
category_id_list
):
def
createCategoriesInCategory
(
self
,
category
,
category_id_list
):
for
category_id
in
category_id_list
:
for
category_id
in
category_id_list
:
child
=
category
child
=
category
for
id
in
category_id
.
split
(
'/'
):
for
id
_
in
category_id
.
split
(
'/'
):
try
:
try
:
child
=
child
[
id
]
child
=
child
[
id
_
]
except
KeyError
:
except
KeyError
:
child
=
child
.
newContent
(
id
)
child
=
child
.
newContent
(
id
_
)
def
createCategories
(
self
):
def
createCategories
(
self
):
"""Create the categories for our test. """
"""Create the categories for our test. """
...
@@ -101,16 +101,16 @@ class TestConversionInSimulation(AccountingTestCase):
...
@@ -101,16 +101,16 @@ class TestConversionInSimulation(AccountingTestCase):
[
'accounting'
,
'delivery'
,
'invoicing'
,
'discount'
,
'tax'
,
'payment'
])
[
'accounting'
,
'delivery'
,
'invoicing'
,
'discount'
,
'tax'
,
'payment'
])
_
(
category_tool
.
product_line
,
[
'apparel'
])
_
(
category_tool
.
product_line
,
[
'apparel'
])
def
_solveDivergence
(
self
,
obj
,
prop
erty
,
decision
,
group
=
'line'
):
def
_solveDivergence
(
self
,
obj
,
prop
,
decision
,
group
=
'line'
):
"""
"""
Check if simulation movement are disconnected
Check if simulation movement are disconnected
"""
"""
kw
=
{
'%s_group_listbox'
%
group
:{}}
kw
=
{
'%s_group_listbox'
%
group
:{}}
for
divergence
in
obj
.
getDivergenceList
():
for
divergence
in
obj
.
getDivergenceList
():
if
divergence
.
getProperty
(
'tested_property'
)
!=
prop
erty
:
if
divergence
.
getProperty
(
'tested_property'
)
!=
prop
:
continue
continue
sm_url
=
divergence
.
getProperty
(
'simulation_movement'
).
getRelativeUrl
()
sm_url
=
divergence
.
getProperty
(
'simulation_movement'
).
getRelativeUrl
()
kw
[
'line_group_listbox'
][
'%s&%s'
%
(
sm_url
,
prop
erty
)]
=
{
kw
[
'line_group_listbox'
][
'%s&%s'
%
(
sm_url
,
prop
)]
=
{
'choice'
:
decision
}
'choice'
:
decision
}
self
.
portal
.
portal_workflow
.
doActionFor
(
self
.
portal
.
portal_workflow
.
doActionFor
(
obj
,
obj
,
...
@@ -144,7 +144,7 @@ class TestConversionInSimulation(AccountingTestCase):
...
@@ -144,7 +144,7 @@ class TestConversionInSimulation(AccountingTestCase):
self
.
tic
()
self
.
tic
()
super
(
TestConversionInSimulation
,
self
).
beforeTearDown
()
super
(
TestConversionInSimulation
,
self
).
beforeTearDown
()
def
login
(
self
,
name
=
username
,
quiet
=
0
,
run
=
run_all_test
):
def
login
(
self
,
*
args
,
**
kw
):
uf
=
self
.
getPortal
().
acl_users
uf
=
self
.
getPortal
().
acl_users
uf
.
_doAddUser
(
self
.
username
,
''
,
[
'Assignee'
,
'Assignor'
,
uf
.
_doAddUser
(
self
.
username
,
''
,
[
'Assignee'
,
'Assignor'
,
'Author'
],
[])
'Author'
],
[])
...
@@ -247,7 +247,7 @@ class TestConversionInSimulation(AccountingTestCase):
...
@@ -247,7 +247,7 @@ class TestConversionInSimulation(AccountingTestCase):
"""
"""
if
not
run
:
return
if
not
run
:
return
if
not
quiet
:
if
not
quiet
:
printAndLog
(
'test_01_simulation_movement_destination_asset_price'
)
printAndLog
(
'test_01_simulation_movement_destination_asset_price'
)
resource
=
self
.
portal
.
product_module
.
newContent
(
resource
=
self
.
portal
.
product_module
.
newContent
(
portal_type
=
'Product'
,
portal_type
=
'Product'
,
title
=
'Resource'
,
title
=
'Resource'
,
...
@@ -291,10 +291,10 @@ class TestConversionInSimulation(AccountingTestCase):
...
@@ -291,10 +291,10 @@ class TestConversionInSimulation(AccountingTestCase):
price_currency_value
=
currency
,
price_currency_value
=
currency
,
specialise_value
=
self
.
business_process
,
specialise_value
=
self
.
business_process
,
title
=
'Order'
)
title
=
'Order'
)
order
_line
=
order
.
newContent
(
portal_type
=
'Sale Order Line'
,
order
.
newContent
(
portal_type
=
'Sale Order Line'
,
resource_value
=
resource
,
resource_value
=
resource
,
quantity
=
1
,
quantity
=
1
,
price
=
2
)
price
=
2
)
order
.
confirm
()
order
.
confirm
()
self
.
tic
()
self
.
tic
()
...
@@ -339,7 +339,7 @@ class TestConversionInSimulation(AccountingTestCase):
...
@@ -339,7 +339,7 @@ class TestConversionInSimulation(AccountingTestCase):
"""
"""
if
not
run
:
return
if
not
run
:
return
if
not
quiet
:
if
not
quiet
:
printAndLog
(
'test_01_simulation_movement_source_asset_price'
)
printAndLog
(
'test_01_simulation_movement_source_asset_price'
)
resource
=
self
.
portal
.
product_module
.
newContent
(
resource
=
self
.
portal
.
product_module
.
newContent
(
portal_type
=
'Product'
,
portal_type
=
'Product'
,
title
=
'Resource'
,
title
=
'Resource'
,
...
@@ -383,10 +383,10 @@ class TestConversionInSimulation(AccountingTestCase):
...
@@ -383,10 +383,10 @@ class TestConversionInSimulation(AccountingTestCase):
price_currency_value
=
currency
,
price_currency_value
=
currency
,
specialise_value
=
self
.
business_process
,
specialise_value
=
self
.
business_process
,
title
=
'Order'
)
title
=
'Order'
)
order
_line
=
order
.
newContent
(
portal_type
=
'Sale Order Line'
,
order
.
newContent
(
portal_type
=
'Sale Order Line'
,
resource_value
=
resource
,
resource_value
=
resource
,
quantity
=
1
,
quantity
=
1
,
price
=
2
)
price
=
2
)
order
.
confirm
()
order
.
confirm
()
self
.
tic
()
self
.
tic
()
...
@@ -421,7 +421,7 @@ class TestConversionInSimulation(AccountingTestCase):
...
@@ -421,7 +421,7 @@ class TestConversionInSimulation(AccountingTestCase):
"""
"""
if
not
run
:
return
if
not
run
:
return
if
not
quiet
:
if
not
quiet
:
printAndLog
(
printAndLog
(
'test_01_destination_total_asset_price_on_accounting_lines'
)
'test_01_destination_total_asset_price_on_accounting_lines'
)
resource
=
self
.
portal
.
product_module
.
newContent
(
resource
=
self
.
portal
.
product_module
.
newContent
(
...
@@ -467,10 +467,10 @@ class TestConversionInSimulation(AccountingTestCase):
...
@@ -467,10 +467,10 @@ class TestConversionInSimulation(AccountingTestCase):
price_currency_value
=
currency
,
price_currency_value
=
currency
,
specialise_value
=
self
.
business_process
,
specialise_value
=
self
.
business_process
,
title
=
'Order'
)
title
=
'Order'
)
order
_line
=
order
.
newContent
(
portal_type
=
'Sale Order Line'
,
order
.
newContent
(
portal_type
=
'Sale Order Line'
,
resource_value
=
resource
,
resource_value
=
resource
,
quantity
=
1
,
quantity
=
1
,
price
=
2
)
price
=
2
)
order
.
confirm
()
order
.
confirm
()
self
.
tic
()
self
.
tic
()
self
.
buildPackingLists
()
self
.
buildPackingLists
()
...
@@ -495,7 +495,7 @@ class TestConversionInSimulation(AccountingTestCase):
...
@@ -495,7 +495,7 @@ class TestConversionInSimulation(AccountingTestCase):
portal_type
=
self
.
portal
.
getPortalAccountingMovementTypeList
())
portal_type
=
self
.
portal
.
getPortalAccountingMovementTypeList
())
self
.
assertNotEquals
(
line_list
,
None
)
self
.
assertNotEquals
(
line_list
,
None
)
for
line
in
line_list
:
for
line
in
line_list
:
self
.
assertEqual
(
line
.
getDestinationTotalAssetPrice
(),
self
.
assertEqual
(
line
.
getDestinationTotalAssetPrice
(),
round
(
655.957
*
delivery_movement
.
getTotalPrice
()))
round
(
655.957
*
delivery_movement
.
getTotalPrice
()))
def
test_01_diverged_sale_packing_list_destination_total_asset_price
(
def
test_01_diverged_sale_packing_list_destination_total_asset_price
(
...
@@ -509,7 +509,7 @@ class TestConversionInSimulation(AccountingTestCase):
...
@@ -509,7 +509,7 @@ class TestConversionInSimulation(AccountingTestCase):
"""
"""
if
not
run
:
return
if
not
run
:
return
if
not
quiet
:
if
not
quiet
:
printAndLog
(
printAndLog
(
'test_01_diverged_sale_packing_list_destination_total_asset_price'
)
'test_01_diverged_sale_packing_list_destination_total_asset_price'
)
resource
=
self
.
portal
.
product_module
.
newContent
(
resource
=
self
.
portal
.
product_module
.
newContent
(
...
@@ -555,10 +555,10 @@ class TestConversionInSimulation(AccountingTestCase):
...
@@ -555,10 +555,10 @@ class TestConversionInSimulation(AccountingTestCase):
price_currency_value
=
currency
,
price_currency_value
=
currency
,
specialise_value
=
self
.
business_process
,
specialise_value
=
self
.
business_process
,
title
=
'Order'
)
title
=
'Order'
)
order
_line
=
order
.
newContent
(
portal_type
=
'Sale Order Line'
,
order
.
newContent
(
portal_type
=
'Sale Order Line'
,
resource_value
=
resource
,
resource_value
=
resource
,
quantity
=
5
,
quantity
=
5
,
price
=
2
)
price
=
2
)
order
.
confirm
()
order
.
confirm
()
self
.
tic
()
self
.
tic
()
self
.
buildPackingLists
()
self
.
buildPackingLists
()
...
@@ -608,7 +608,7 @@ class TestConversionInSimulation(AccountingTestCase):
...
@@ -608,7 +608,7 @@ class TestConversionInSimulation(AccountingTestCase):
"""
"""
if
not
run
:
return
if
not
run
:
return
if
not
quiet
:
if
not
quiet
:
printAndLog
(
printAndLog
(
'test_01_diverged_purchase_packing_list_source_total_asset_price'
)
'test_01_diverged_purchase_packing_list_source_total_asset_price'
)
resource
=
self
.
portal
.
product_module
.
newContent
(
resource
=
self
.
portal
.
product_module
.
newContent
(
...
@@ -654,10 +654,10 @@ class TestConversionInSimulation(AccountingTestCase):
...
@@ -654,10 +654,10 @@ class TestConversionInSimulation(AccountingTestCase):
price_currency_value
=
currency
,
price_currency_value
=
currency
,
specialise_value
=
self
.
business_process
,
specialise_value
=
self
.
business_process
,
title
=
'Order'
)
title
=
'Order'
)
order
_line
=
order
.
newContent
(
portal_type
=
'Purchase Order Line'
,
order
.
newContent
(
portal_type
=
'Purchase Order Line'
,
resource_value
=
resource
,
resource_value
=
resource
,
quantity
=
5
,
quantity
=
5
,
price
=
2
)
price
=
2
)
order
.
confirm
()
order
.
confirm
()
self
.
tic
()
self
.
tic
()
self
.
buildPackingLists
()
self
.
buildPackingLists
()
...
@@ -707,7 +707,7 @@ class TestConversionInSimulation(AccountingTestCase):
...
@@ -707,7 +707,7 @@ class TestConversionInSimulation(AccountingTestCase):
"""
"""
if
not
run
:
return
if
not
run
:
return
if
not
quiet
:
if
not
quiet
:
printAndLog
(
printAndLog
(
'test_01_delivery_mode_on_sale_packing_list_and_invoice'
)
'test_01_delivery_mode_on_sale_packing_list_and_invoice'
)
resource
=
self
.
portal
.
product_module
.
newContent
(
resource
=
self
.
portal
.
product_module
.
newContent
(
...
@@ -755,10 +755,10 @@ class TestConversionInSimulation(AccountingTestCase):
...
@@ -755,10 +755,10 @@ class TestConversionInSimulation(AccountingTestCase):
incoterm
=
self
.
cpt_incoterm
,
incoterm
=
self
.
cpt_incoterm
,
specialise_value
=
self
.
business_process
,
specialise_value
=
self
.
business_process
,
title
=
'Order'
)
title
=
'Order'
)
order
_line
=
order
.
newContent
(
portal_type
=
'Sale Order Line'
,
order
.
newContent
(
portal_type
=
'Sale Order Line'
,
resource_value
=
resource
,
resource_value
=
resource
,
quantity
=
5
,
quantity
=
5
,
price
=
2
)
price
=
2
)
order
.
confirm
()
order
.
confirm
()
self
.
tic
()
self
.
tic
()
self
.
buildPackingLists
()
self
.
buildPackingLists
()
...
@@ -788,7 +788,7 @@ class TestConversionInSimulation(AccountingTestCase):
...
@@ -788,7 +788,7 @@ class TestConversionInSimulation(AccountingTestCase):
"""
"""
if
not
run
:
return
if
not
run
:
return
if
not
quiet
:
if
not
quiet
:
printAndLog
(
printAndLog
(
'test_01_quantity_unit_on_sale_packing_list'
)
'test_01_quantity_unit_on_sale_packing_list'
)
resource
=
self
.
portal
.
product_module
.
newContent
(
resource
=
self
.
portal
.
product_module
.
newContent
(
...
...
bt5/erp5_accounting_ui_test/TestTemplateItem/portal_components/test.erp5.testConversionInSimulation.xml
0 → 100644
View file @
b6ccfc26
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Test Component"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
testConversionInSimulation
</string>
</value>
</item>
<item>
<key>
<string>
default_source_reference
</string>
</key>
<value>
<string>
Products.ERP5.tests.testConversionInSimulation
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
test.erp5.testConversionInSimulation
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Test Component
</string>
</value>
</item>
<item>
<key>
<string>
sid
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
text_content_error_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
erp5
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
product/ERP5/tests/
testERP5CurrencyExchangeLine.py
→
bt5/erp5_accounting_ui_test/TestTemplateItem/portal_components/test.erp5.
testERP5CurrencyExchangeLine.py
View file @
b6ccfc26
...
@@ -28,7 +28,7 @@
...
@@ -28,7 +28,7 @@
import
unittest
import
unittest
from
DateTime
import
DateTime
from
DateTime
import
DateTime
from
Products.ERP5.tests
.testAccounting
import
AccountingTestCase
from
erp5.component.test
.testAccounting
import
AccountingTestCase
from
AccessControl.SecurityManagement
import
newSecurityManager
from
AccessControl.SecurityManagement
import
newSecurityManager
class
CurrencyExchangeTestCase
(
AccountingTestCase
):
class
CurrencyExchangeTestCase
(
AccountingTestCase
):
...
@@ -56,7 +56,7 @@ class CurrencyExchangeTestCase(AccountingTestCase):
...
@@ -56,7 +56,7 @@ class CurrencyExchangeTestCase(AccountingTestCase):
self
.
tic
()
self
.
tic
()
def
login
(
self
,
name
=
username
):
def
login
(
self
,
*
args
,
**
kw
):
uf
=
self
.
getPortal
().
acl_users
uf
=
self
.
getPortal
().
acl_users
uf
.
_doAddUser
(
self
.
username
,
''
,
[
'Assignee'
,
'Assignor'
,
uf
.
_doAddUser
(
self
.
username
,
''
,
[
'Assignee'
,
'Assignor'
,
'Author'
,
'Manager'
],
[])
'Author'
,
'Manager'
],
[])
...
@@ -146,7 +146,6 @@ class TestCurrencyExchangeLine(CurrencyExchangeTestCase):
...
@@ -146,7 +146,6 @@ class TestCurrencyExchangeLine(CurrencyExchangeTestCase):
x_curr_ex_line
.
validate
()
x_curr_ex_line
.
validate
()
self
.
assertEqual
(
x_curr_ex_line
.
getValidationState
(),
self
.
assertEqual
(
x_curr_ex_line
.
getValidationState
(),
'validated'
)
'validated'
)
accounting_module
=
self
.
portal
.
accounting_module
invoice
=
self
.
_makeOne
(
invoice
=
self
.
_makeOne
(
portal_type
=
'Purchase Invoice Transaction'
,
portal_type
=
'Purchase Invoice Transaction'
,
stop_date
=
DateTime
(
'2008/09/08'
),
stop_date
=
DateTime
(
'2008/09/08'
),
...
@@ -195,21 +194,16 @@ class TestCurrencyExchangeLine(CurrencyExchangeTestCase):
...
@@ -195,21 +194,16 @@ class TestCurrencyExchangeLine(CurrencyExchangeTestCase):
self
.
assertEqual
(
x_curr_ex_line
.
getValidationState
(),
self
.
assertEqual
(
x_curr_ex_line
.
getValidationState
(),
'validated'
)
'validated'
)
yen
=
self
.
portal
.
currency_module
.
yen
yen
=
self
.
portal
.
currency_module
.
yen
yen_line1
=
yen
.
newContent
(
yen
.
newContent
(
portal_type
=
'Currency Exchange Line'
)
portal_type
=
'Currency Exchange Line'
)
yen
.
newContent
(
portal_type
=
'Currency Exchange Line'
)
yen_line2
=
yen
.
newContent
(
portal_type
=
'Currency Exchange Line'
)
usd
=
self
.
portal
.
currency_module
.
usd
usd
=
self
.
portal
.
currency_module
.
usd
usd_line1
=
usd
.
newContent
(
usd
.
newContent
(
portal_type
=
'Currency Exchange Line'
)
portal_type
=
'Currency Exchange Line'
)
usd
.
newContent
(
portal_type
=
'Currency Exchange Line'
)
usd_line2
=
usd
.
newContent
(
portal_type
=
'Currency Exchange Line'
)
euro_line
=
euro
.
newContent
(
euro_line
=
euro
.
newContent
(
portal_type
=
'Currency Exchange Line'
)
portal_type
=
'Currency Exchange Line'
)
euro_line
.
validate
()
euro_line
.
validate
()
accounting_module
=
self
.
portal
.
accounting_module
invoice
=
self
.
_makeOne
(
invoice
=
self
.
_makeOne
(
portal_type
=
'Purchase Invoice Transaction'
,
portal_type
=
'Purchase Invoice Transaction'
,
stop_date
=
DateTime
(
'2008/09/08'
),
stop_date
=
DateTime
(
'2008/09/08'
),
...
@@ -256,7 +250,6 @@ class TestCurrencyExchangeLine(CurrencyExchangeTestCase):
...
@@ -256,7 +250,6 @@ class TestCurrencyExchangeLine(CurrencyExchangeTestCase):
x_curr_ex_line
.
validate
()
x_curr_ex_line
.
validate
()
self
.
assertEqual
(
x_curr_ex_line
.
getValidationState
(),
self
.
assertEqual
(
x_curr_ex_line
.
getValidationState
(),
'validated'
)
'validated'
)
accounting_module
=
self
.
portal
.
accounting_module
invoice
=
self
.
_makeOne
(
invoice
=
self
.
_makeOne
(
portal_type
=
'Sale Invoice Transaction'
,
portal_type
=
'Sale Invoice Transaction'
,
start_date
=
DateTime
(
'2008/09/08'
),
start_date
=
DateTime
(
'2008/09/08'
),
...
@@ -294,8 +287,6 @@ class TestCurrencyExchangeLine(CurrencyExchangeTestCase):
...
@@ -294,8 +287,6 @@ class TestCurrencyExchangeLine(CurrencyExchangeTestCase):
self
.
tic
()
self
.
tic
()
self
.
organisation1
.
edit
(
self
.
organisation1
.
edit
(
price_currency
=
new_currency
.
getRelativeUrl
())
price_currency
=
new_currency
.
getRelativeUrl
())
euro
=
self
.
portal
.
currency_module
.
euro
accounting_module
=
self
.
portal
.
accounting_module
invoice
=
self
.
_makeOne
(
invoice
=
self
.
_makeOne
(
portal_type
=
'Purchase Invoice Transaction'
,
portal_type
=
'Purchase Invoice Transaction'
,
stop_date
=
DateTime
(
'2008/09/08'
),
stop_date
=
DateTime
(
'2008/09/08'
),
...
@@ -345,7 +336,6 @@ class TestCurrencyExchangeLine(CurrencyExchangeTestCase):
...
@@ -345,7 +336,6 @@ class TestCurrencyExchangeLine(CurrencyExchangeTestCase):
x_curr_ex_line
.
validate
()
x_curr_ex_line
.
validate
()
self
.
assertEqual
(
x_curr_ex_line
.
getValidationState
(),
self
.
assertEqual
(
x_curr_ex_line
.
getValidationState
(),
'validated'
)
'validated'
)
accounting_module
=
self
.
portal
.
accounting_module
transaction1
=
self
.
_makeOne
(
transaction1
=
self
.
_makeOne
(
portal_type
=
'Purchase Invoice Transaction'
,
portal_type
=
'Purchase Invoice Transaction'
,
stop_date
=
DateTime
(
'2008/09/08'
),
stop_date
=
DateTime
(
'2008/09/08'
),
...
@@ -413,7 +403,6 @@ class TestCurrencyExchangeLine(CurrencyExchangeTestCase):
...
@@ -413,7 +403,6 @@ class TestCurrencyExchangeLine(CurrencyExchangeTestCase):
self
.
assertEqual
(
x_curr_ex_line
.
getValidationState
(),
self
.
assertEqual
(
x_curr_ex_line
.
getValidationState
(),
'validated'
)
'validated'
)
accounting_module
=
self
.
portal
.
accounting_module
invoice
=
self
.
_makeOne
(
invoice
=
self
.
_makeOne
(
portal_type
=
'Purchase Invoice Transaction'
,
portal_type
=
'Purchase Invoice Transaction'
,
stop_date
=
DateTime
(
'2008/09/08'
),
stop_date
=
DateTime
(
'2008/09/08'
),
...
@@ -429,8 +418,7 @@ class TestCurrencyExchangeLine(CurrencyExchangeTestCase):
...
@@ -429,8 +418,7 @@ class TestCurrencyExchangeLine(CurrencyExchangeTestCase):
line_list
=
invoice
.
contentValues
(
line_list
=
invoice
.
contentValues
(
portal_type
=
self
.
portal
.
getPortalAccountingMovementTypeList
())
portal_type
=
self
.
portal
.
getPortalAccountingMovementTypeList
())
for
line
in
line_list
:
for
line
in
line_list
:
self
.
assertEqual
(
line
.
getDestinationTotalAssetPrice
(),
self
.
assertEqual
(
line
.
getDestinationTotalAssetPrice
(),
None
)
None
)
def
test_CreateCELWithNoBasePrice
(
self
):
def
test_CreateCELWithNoBasePrice
(
self
):
...
@@ -476,7 +464,6 @@ class TestCurrencyExchangeLine(CurrencyExchangeTestCase):
...
@@ -476,7 +464,6 @@ class TestCurrencyExchangeLine(CurrencyExchangeTestCase):
self
.
assertEqual
(
euro_line2
.
getValidationState
(),
self
.
assertEqual
(
euro_line2
.
getValidationState
(),
'validated'
)
'validated'
)
accounting_module
=
self
.
portal
.
accounting_module
invoice
=
self
.
_makeOne
(
invoice
=
self
.
_makeOne
(
portal_type
=
'Purchase Invoice Transaction'
,
portal_type
=
'Purchase Invoice Transaction'
,
stop_date
=
DateTime
(
'2008/09/08'
),
stop_date
=
DateTime
(
'2008/09/08'
),
...
...
bt5/erp5_accounting_ui_test/TestTemplateItem/portal_components/test.erp5.testERP5CurrencyExchangeLine.xml
0 → 100644
View file @
b6ccfc26
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Test Component"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
testERP5CurrencyExchangeLine
</string>
</value>
</item>
<item>
<key>
<string>
default_source_reference
</string>
</key>
<value>
<string>
Products.ERP5.tests.testERP5CurrencyExchangeLine
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
test.erp5.testERP5CurrencyExchangeLine
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Test Component
</string>
</value>
</item>
<item>
<key>
<string>
sid
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
text_content_error_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
erp5
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_accounting_ui_test/bt/template_test_id_list
0 → 100644
View file @
b6ccfc26
test.erp5.testConversionInSimulation
test.erp5.testERP5CurrencyExchangeLine
\ No newline at end of file
bt5/erp5_accounting_ui_test/bt/test_dependency_list
View file @
b6ccfc26
erp5_full_text_mroonga_catalog
erp5_base
erp5_core_proxy_field_legacy
erp5_pdm
erp5_simulation
erp5_trade
erp5_simulation_test
erp5_simulation_test
erp5_simplified_invoicing
erp5_simplified_invoicing
erp5_configurator_standard_accounting_template
erp5_configurator_standard_solver
\ No newline at end of file
erp5_configurator_standard_trade_template
erp5_configurator_standard_invoicing_template
\ No newline at end of file
bt5/erp5_bank_reconciliation/TestTemplateItem/portal_components/test.erp5.testBankReconciliation.py
View file @
b6ccfc26
...
@@ -35,7 +35,7 @@ from DateTime import DateTime
...
@@ -35,7 +35,7 @@ from DateTime import DateTime
from
Products.DCWorkflow.DCWorkflow
import
ValidationFailed
from
Products.DCWorkflow.DCWorkflow
import
ValidationFailed
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5ReportTestCase
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5ReportTestCase
from
Products.ERP5.tests
.testAccounting
import
AccountingTestCase
from
erp5.component.test
.testAccounting
import
AccountingTestCase
class
TestBankReconciliation
(
AccountingTestCase
,
ERP5ReportTestCase
):
class
TestBankReconciliation
(
AccountingTestCase
,
ERP5ReportTestCase
):
"""Test Bank Reconciliation
"""Test Bank Reconciliation
...
...
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