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
Xavier Thompson
erp5
Commits
9a98dbbc
Commit
9a98dbbc
authored
Sep 22, 2022
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Plain Diff
Python3: Apply 2to3 numliterals
See merge request
nexedi/erp5!1671
parents
0048d09c
b9692ab0
Changes
19
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
121 additions
and
117 deletions
+121
-117
bt5/erp5_accounting_ui_test/SkinTemplateItem/portal_skins/erp5_accounting_ui_test/AccountingTransactionModule_createAccountingTransactionList.py
...ntingTransactionModule_createAccountingTransactionList.py
+1
-1
bt5/erp5_accounting_ui_test/SkinTemplateItem/portal_skins/erp5_accounting_ui_test/AccountingTransactionModule_createAccountingTransactionListSalesAndPayments.py
...Module_createAccountingTransactionListSalesAndPayments.py
+2
-2
bt5/erp5_certificate_authority/ToolComponentTemplateItem/portal_components/tool.erp5.CertificateAuthorityTool.py
...m/portal_components/tool.erp5.CertificateAuthorityTool.py
+1
-1
bt5/erp5_configurator/ModuleComponentTemplateItem/portal_components/module.erp5.ConfiguratorTestMixin.py
...em/portal_components/module.erp5.ConfiguratorTestMixin.py
+19
-19
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testAlarm.py
...TestTemplateItem/portal_components/test.erp5.testAlarm.py
+6
-6
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testERP5Base.py
...tTemplateItem/portal_components/test.erp5.testERP5Base.py
+3
-3
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testFields.py
...estTemplateItem/portal_components/test.erp5.testFields.py
+1
-1
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testPreferences.py
...mplateItem/portal_components/test.erp5.testPreferences.py
+2
-2
bt5/erp5_payroll/TestTemplateItem/portal_components/test.erp5.testPayroll.py
...stTemplateItem/portal_components/test.erp5.testPayroll.py
+28
-28
bt5/erp5_payroll_l10n_fr/TestTemplateItem/portal_components/test.erp5.testDSNSocialDeclarationReport.py
...al_components/test.erp5.testDSNSocialDeclarationReport.py
+1
-1
bt5/erp5_simplified_invoicing/TestTemplateItem/portal_components/test.erp5.testInvoice.py
...stTemplateItem/portal_components/test.erp5.testInvoice.py
+8
-8
bt5/erp5_simplified_invoicing/TestTemplateItem/portal_components/test.erp5.testTradeCondition.py
...ateItem/portal_components/test.erp5.testTradeCondition.py
+7
-7
bt5/erp5_tiosafe_core/ModuleComponentTemplateItem/portal_components/module.erp5.ERP5NodeConduit.py
...lateItem/portal_components/module.erp5.ERP5NodeConduit.py
+1
-1
bt5/erp5_tiosafe_core/ModuleComponentTemplateItem/portal_components/module.erp5.ERP5PaymentTransactionConduit.py
...l_components/module.erp5.ERP5PaymentTransactionConduit.py
+1
-1
bt5/erp5_trade/TestTemplateItem/portal_components/test.erp5.testInventoryModule.py
...teItem/portal_components/test.erp5.testInventoryModule.py
+3
-3
bt5/erp5_web_service/DocumentTemplateItem/portal_components/document.erp5.FTPConnector.py
...plateItem/portal_components/document.erp5.FTPConnector.py
+1
-1
bt5/erp5_web_service/ModuleComponentTemplateItem/portal_components/module.erp5.SFTPConnection.py
...plateItem/portal_components/module.erp5.SFTPConnection.py
+1
-1
product/ERP5/tests/testInventoryAPI.py
product/ERP5/tests/testInventoryAPI.py
+31
-31
product/ERP5Type/tests/Python3StyleTest.py
product/ERP5Type/tests/Python3StyleTest.py
+4
-0
No files found.
bt5/erp5_accounting_ui_test/SkinTemplateItem/portal_skins/erp5_accounting_ui_test/AccountingTransactionModule_createAccountingTransactionList.py
View file @
9a98dbbc
...
...
@@ -5,7 +5,7 @@ from Products.ZSQLCatalog.SQLCatalog import SimpleQuery
portal
=
context
.
getPortalObject
()
accounting_module
=
portal
.
accounting_module
year
=
2005
default_date
=
DateTime
(
year
,
01
,
0
1
)
default_date
=
DateTime
(
year
,
1
,
1
)
business_process
=
portal
.
portal_catalog
.
getResultValue
(
reference
=
(
'default_erp5_business_process'
,
# erp5_configurator
...
...
bt5/erp5_accounting_ui_test/SkinTemplateItem/portal_skins/erp5_accounting_ui_test/AccountingTransactionModule_createAccountingTransactionListSalesAndPayments.py
View file @
9a98dbbc
...
...
@@ -98,8 +98,8 @@ for month in range(1, month_count + 1):
source_payment
=
getBankAccountByTitle
(
'My default bank account'
),
destination_section
=
getOrganisationByTitle
(
client_title
),
created_by_builder
=
1
,
start_date
=
DateTime
(
year
,
month
,
day
,
01
,
0
1
)
+
10
,
stop_date
=
DateTime
(
year
,
month
,
day
,
01
,
0
1
)
+
10
,
start_date
=
DateTime
(
year
,
month
,
day
,
1
,
1
)
+
10
,
stop_date
=
DateTime
(
year
,
month
,
day
,
1
,
1
)
+
10
,
causality_value
=
tr
,
resource
=
euro_resource
,
)
...
...
bt5/erp5_certificate_authority/ToolComponentTemplateItem/portal_components/tool.erp5.CertificateAuthorityTool.py
View file @
9a98dbbc
...
...
@@ -208,7 +208,7 @@ class CertificateAuthorityTool(BaseTool):
cert
=
os
.
path
.
join
(
self
.
certificate_authority_path
,
'certs'
,
new_id
+
'.crt'
)
try
:
os
.
close
(
os
.
open
(
key
,
os
.
O_CREAT
|
os
.
O_EXCL
,
0600
))
os
.
close
(
os
.
open
(
key
,
os
.
O_CREAT
|
os
.
O_EXCL
,
0
o
600
))
popenCommunicate
([
self
.
openssl_binary
,
'req'
,
'-utf8'
,
'-nodes'
,
'-config'
,
self
.
openssl_config
,
'-new'
,
'-keyout'
,
key
,
'-out'
,
csr
,
'-days'
,
'3650'
],
'%s
\
n
'
%
common_name
,
stdin
=
subprocess
.
PIPE
)
...
...
bt5/erp5_configurator/ModuleComponentTemplateItem/portal_components/module.erp5.ConfiguratorTestMixin.py
View file @
9a98dbbc
...
...
@@ -822,7 +822,7 @@ class TestLiveConfiguratorWorkflowMixin(SecurityTestCase):
group
=
'my_group'
)
accounting_period
=
organisation
.
newContent
(
portal_type
=
'Accounting Period'
,
start_date
=
DateTime
(
2001
,
01
,
0
1
),
start_date
=
DateTime
(
2001
,
1
,
1
),
stop_date
=
DateTime
(
2002
,
12
,
31
))
self
.
assertEqual
(
accounting_period
.
getSimulationState
(),
'draft'
)
...
...
@@ -1054,8 +1054,8 @@ class TestLiveConfiguratorWorkflowMixin(SecurityTestCase):
def
stepAccountingTransaction
(
self
,
sequence
=
None
,
sequence_list
=
None
,
**
kw
):
transaction
=
self
.
portal
.
accounting_module
.
newContent
(
portal_type
=
'Accounting Transaction'
,
start_date
=
DateTime
(
2001
,
01
,
0
1
),
stop_date
=
DateTime
(
2001
,
01
,
0
1
))
start_date
=
DateTime
(
2001
,
1
,
1
),
stop_date
=
DateTime
(
2001
,
1
,
1
))
self
.
assertEqual
(
'draft'
,
transaction
.
getSimulationState
())
for
user_id
in
self
.
_getUserIdList
(
self
.
all_username_list
):
self
.
assertUserCanViewDocument
(
user_id
,
transaction
)
...
...
@@ -1186,8 +1186,8 @@ class TestLiveConfiguratorWorkflowMixin(SecurityTestCase):
def
stepSaleInvoiceTransaction
(
self
,
sequence
=
None
,
sequence_list
=
None
,
**
kw
):
transaction
=
self
.
portal
.
accounting_module
.
newContent
(
portal_type
=
'Sale Invoice Transaction'
,
start_date
=
DateTime
(
2001
,
01
,
0
1
),
stop_date
=
DateTime
(
2001
,
01
,
0
1
))
start_date
=
DateTime
(
2001
,
1
,
1
),
stop_date
=
DateTime
(
2001
,
1
,
1
))
self
.
assertEqual
(
'draft'
,
transaction
.
getSimulationState
())
for
user_id
in
self
.
_getUserIdList
(
self
.
all_username_list
):
self
.
assertUserCanViewDocument
(
user_id
,
transaction
)
...
...
@@ -1329,8 +1329,8 @@ class TestLiveConfiguratorWorkflowMixin(SecurityTestCase):
def
stepPurchaseInvoiceTransaction
(
self
,
sequence
=
None
,
sequence_list
=
None
,
**
kw
):
transaction
=
self
.
portal
.
accounting_module
.
newContent
(
portal_type
=
'Purchase Invoice Transaction'
,
start_date
=
DateTime
(
2001
,
01
,
0
1
),
stop_date
=
DateTime
(
2001
,
01
,
0
1
))
start_date
=
DateTime
(
2001
,
1
,
1
),
stop_date
=
DateTime
(
2001
,
1
,
1
))
self
.
assertEqual
(
'draft'
,
transaction
.
getSimulationState
())
for
user_id
in
self
.
_getUserIdList
(
self
.
all_username_list
):
self
.
assertUserCanViewDocument
(
user_id
,
transaction
)
...
...
@@ -1476,8 +1476,8 @@ class TestLiveConfiguratorWorkflowMixin(SecurityTestCase):
def
stepPaymentTransaction
(
self
,
sequence
=
None
,
sequence_list
=
None
,
**
kw
):
transaction
=
self
.
portal
.
accounting_module
.
newContent
(
portal_type
=
'Payment Transaction'
,
start_date
=
DateTime
(
2001
,
01
,
0
1
),
stop_date
=
DateTime
(
2001
,
01
,
0
1
))
start_date
=
DateTime
(
2001
,
1
,
1
),
stop_date
=
DateTime
(
2001
,
1
,
1
))
self
.
assertEqual
(
'draft'
,
transaction
.
getSimulationState
())
for
user_id
in
self
.
_getUserIdList
(
self
.
all_username_list
):
self
.
assertUserCanViewDocument
(
user_id
,
transaction
)
...
...
@@ -1621,29 +1621,29 @@ class TestLiveConfiguratorWorkflowMixin(SecurityTestCase):
accounting_transaction_x_related_to_a
=
self
.
portal
.
\
accounting_module
.
newContent
(
portal_type
=
'Accounting Transaction'
,
start_date
=
DateTime
(
2010
,
06
,
0
1
),
stop_date
=
DateTime
(
2010
,
06
,
0
1
))
start_date
=
DateTime
(
2010
,
6
,
1
),
stop_date
=
DateTime
(
2010
,
6
,
1
))
accounting_transaction_y_related_to_a
=
self
.
portal
.
\
accounting_module
.
newContent
(
portal_type
=
'Accounting Transaction'
,
start_date
=
DateTime
(
2010
,
06
,
0
1
),
stop_date
=
DateTime
(
2010
,
06
,
0
1
))
start_date
=
DateTime
(
2010
,
6
,
1
),
stop_date
=
DateTime
(
2010
,
6
,
1
))
accounting_transaction_a
=
self
.
portal
.
accounting_module
.
newContent
(
portal_type
=
'Accounting Transaction'
,
start_date
=
DateTime
(
2010
,
06
,
0
1
),
stop_date
=
DateTime
(
2010
,
06
,
0
1
))
start_date
=
DateTime
(
2010
,
6
,
1
),
stop_date
=
DateTime
(
2010
,
6
,
1
))
accounting_transaction_b
=
self
.
portal
.
accounting_module
.
newContent
(
portal_type
=
'Accounting Transaction'
,
start_date
=
DateTime
(
2010
,
06
,
0
1
),
stop_date
=
DateTime
(
2010
,
06
,
0
1
))
start_date
=
DateTime
(
2010
,
6
,
1
),
stop_date
=
DateTime
(
2010
,
6
,
1
))
accounting_transaction_c
=
self
.
portal
.
accounting_module
.
newContent
(
portal_type
=
'Accounting Transaction'
,
start_date
=
DateTime
(
2010
,
06
,
0
1
),
stop_date
=
DateTime
(
2010
,
06
,
0
1
))
start_date
=
DateTime
(
2010
,
6
,
1
),
stop_date
=
DateTime
(
2010
,
6
,
1
))
accounting_transaction_x_related_to_a
.
setCausalityValue
(
\
accounting_transaction_a
)
...
...
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testAlarm.py
View file @
9a98dbbc
...
...
@@ -138,7 +138,7 @@ class TestAlarm(ERP5TypeTestCase):
right_first_date
=
DateTime
(
self
.
date_format
%
(
2006
,
10
,
6
,
15
,
00
,
00
))
now
=
DateTime
(
self
.
date_format
%
(
2006
,
10
,
6
,
15
,
00
,
00
))
right_second_date
=
DateTime
(
self
.
date_format
%
(
2006
,
10
,
6
,
21
,
00
,
00
))
right_third_date
=
DateTime
(
self
.
date_format
%
(
2006
,
10
,
7
,
0
6
,
00
,
00
))
right_third_date
=
DateTime
(
self
.
date_format
%
(
2006
,
10
,
7
,
6
,
00
,
00
))
right_fourth_date
=
DateTime
(
self
.
date_format
%
(
2006
,
10
,
7
,
10
,
00
,
00
))
alarm
=
self
.
newAlarm
(
enabled
=
True
)
hour_list
=
(
6
,
10
,
15
,
21
)
...
...
@@ -234,8 +234,8 @@ class TestAlarm(ERP5TypeTestCase):
def
test_09_SomeMonthDaysSomeHours
(
self
):
"""- every 1st and 15th every month, at 12 and 14"""
right_first_date
=
DateTime
(
self
.
date_format
%
(
2006
,
10
,
0
1
,
12
,
00
,
00
))
right_second_date
=
DateTime
(
self
.
date_format
%
(
2006
,
10
,
0
1
,
14
,
00
,
00
))
right_first_date
=
DateTime
(
self
.
date_format
%
(
2006
,
10
,
1
,
12
,
00
,
00
))
right_second_date
=
DateTime
(
self
.
date_format
%
(
2006
,
10
,
1
,
14
,
00
,
00
))
right_third_date
=
DateTime
(
self
.
date_format
%
(
2006
,
10
,
15
,
12
,
00
,
00
))
right_fourth_date
=
DateTime
(
self
.
date_format
%
(
2006
,
10
,
15
,
14
,
00
,
00
))
alarm
=
self
.
newAlarm
(
enabled
=
True
)
...
...
@@ -247,9 +247,9 @@ class TestAlarm(ERP5TypeTestCase):
def
test_10_OnceEvery2Month
(
self
):
"""- every 1st day of every 2 month, at 6"""
right_first_date
=
DateTime
(
self
.
date_format
%
(
2006
,
10
,
0
1
,
6
,
00
,
00
))
right_second_date
=
DateTime
(
self
.
date_format
%
(
2006
,
12
,
0
1
,
6
,
00
,
00
))
right_third_date
=
DateTime
(
self
.
date_format
%
(
2007
,
2
,
0
1
,
6
,
00
,
00
))
right_first_date
=
DateTime
(
self
.
date_format
%
(
2006
,
10
,
1
,
6
,
00
,
00
))
right_second_date
=
DateTime
(
self
.
date_format
%
(
2006
,
12
,
1
,
6
,
00
,
00
))
right_third_date
=
DateTime
(
self
.
date_format
%
(
2007
,
2
,
1
,
6
,
00
,
00
))
alarm
=
self
.
newAlarm
(
enabled
=
True
)
alarm
.
setPeriodicityStartDate
(
right_first_date
)
alarm
.
setPeriodicityMonthDayList
((
1
,))
...
...
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testERP5Base.py
View file @
9a98dbbc
...
...
@@ -799,7 +799,7 @@ class TestERP5Base(ERP5TypeTestCase):
"""Tests dates on Person objects.
"""
pers
=
self
.
getPersonModule
().
newContent
(
portal_type
=
'Person'
)
birthday
=
DateTime
(
1999
,
01
,
0
1
)
birthday
=
DateTime
(
1999
,
1
,
1
)
now
=
DateTime
()
pers
.
edit
(
birthday
=
birthday
)
self
.
assertEqual
(
birthday
,
pers
.
getBirthday
())
...
...
@@ -814,7 +814,7 @@ class TestERP5Base(ERP5TypeTestCase):
"""Tests dates on Organisation objects.
"""
org
=
self
.
getOrganisationModule
().
newContent
(
portal_type
=
'Organisation'
)
start_date
=
DateTime
(
1999
,
01
,
0
1
)
start_date
=
DateTime
(
1999
,
1
,
1
)
now
=
DateTime
()
org
.
edit
(
start_date
=
start_date
)
self
.
assertEqual
(
start_date
,
org
.
getStartDate
())
...
...
@@ -964,7 +964,7 @@ class TestERP5Base(ERP5TypeTestCase):
subordination_value
=
first_organisation
,
start_date
=
DateTime
(
1996
,
9
,
9
))
another_cancelled_career
.
cancel
()
self
.
assertEqual
(
DateTime
(
2001
,
01
,
0
1
),
self
.
assertEqual
(
DateTime
(
2001
,
1
,
1
),
person
.
Person_getCareerStartDate
(
subordination_relative_url
=
first_organisation
.
getRelativeUrl
()))
...
...
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testFields.py
View file @
9a98dbbc
...
...
@@ -384,7 +384,7 @@ class TestDateTimeField(ERP5TypeTestCase):
.
xpath
(
'%s/text()'
%
ODG_XML_WRAPPING_XPATH
,
namespaces
=
NSMAP
)[
0
])
def
test_render_odt_variable
(
self
):
value
=
DateTime
(
2010
,
12
,
0
6
,
10
,
23
,
32
,
'GMT+5'
)
value
=
DateTime
(
2010
,
12
,
6
,
10
,
23
,
32
,
'GMT+5'
)
self
.
field
.
values
[
'default'
]
=
value
node
=
self
.
field
.
render_odt_variable
(
as_string
=
False
)
self
.
assertEqual
(
node
.
get
(
'{%s}value-type'
%
NSMAP
[
'office'
]),
'date'
)
...
...
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testPreferences.py
View file @
9a98dbbc
...
...
@@ -280,7 +280,7 @@ class TestPreferences(PropertySheetTestCase):
portal_workflow
.
doActionFor
(
person1
,
'enable_action'
,
wf_id
=
'preference_workflow'
)
self
.
assertEqual
(
person1
.
getPreferenceState
(),
'enabled'
)
person1
.
setPreferredAccountingTransactionAtDate
(
DateTime
(
2005
,
01
,
0
1
))
person1
.
setPreferredAccountingTransactionAtDate
(
DateTime
(
2005
,
1
,
1
))
pref_tool
.
setPreference
(
'preferred_accounting_transaction_at_date'
,
DateTime
(
2004
,
12
,
31
))
self
.
tic
()
...
...
@@ -320,7 +320,7 @@ class TestPreferences(PropertySheetTestCase):
# create a pref for user_b
user_b_1
=
portal_preferences
.
newContent
(
id
=
'user_b_1'
,
portal_type
=
'Preference'
)
user_b_1
.
setPreferredAccountingTransactionAtDate
(
DateTime
(
2002
,
02
,
0
2
))
user_b_1
.
setPreferredAccountingTransactionAtDate
(
DateTime
(
2002
,
2
,
2
))
self
.
tic
()
# enable this preference
...
...
bt5/erp5_payroll/TestTemplateItem/portal_components/test.erp5.testPayroll.py
View file @
9a98dbbc
...
...
@@ -313,7 +313,7 @@ class TestPayrollMixin(TestTradeModelLineMixin, ERP5ReportTestCase):
employee
=
sequence
.
get
(
'employee'
)
model
.
edit
(
destination_section_value
=
employer
,
source_section_value
=
employee
,
effective_date
=
DateTime
(
2009
,
01
,
0
1
),
effective_date
=
DateTime
(
2009
,
1
,
1
),
expiration_date
=
DateTime
(
2009
,
12
,
31
),
version
=
'001'
,
reference
=
'basic_model'
,
...
...
@@ -552,8 +552,8 @@ class TestPayrollMixin(TestTradeModelLineMixin, ERP5ReportTestCase):
source_section_value
=
sequence
.
get
(
'employee'
),
destination_section_value
=
sequence
.
get
(
'employer'
),
resource_value
=
sequence
.
get
(
'price_currency'
),
start_date
=
DateTime
(
2009
,
06
,
0
1
),
stop_date
=
DateTime
(
2009
,
0
6
,
30
))
start_date
=
DateTime
(
2009
,
6
,
1
),
stop_date
=
DateTime
(
2009
,
6
,
30
))
sequence
.
edit
(
paysheet
=
paysheet
)
def
createPaysheetLine
(
self
,
document
,
**
kw
):
...
...
@@ -1021,7 +1021,7 @@ class TestPayrollMixin(TestTradeModelLineMixin, ERP5ReportTestCase):
model
.
edit
(
\
price_currency_value
=
currency
,
default_payment_condition_trade_date
=
'custom'
,
default_payment_condition_payment_date
=
DateTime
(
2009
,
0
5
,
25
),
default_payment_condition_payment_date
=
DateTime
(
2009
,
5
,
25
),
work_time_annotation_line_quantity
=
151.67
,
work_time_annotation_line_quantity_unit
=
'time/hours'
,
)
...
...
@@ -1042,7 +1042,7 @@ class TestPayrollMixin(TestTradeModelLineMixin, ERP5ReportTestCase):
self
.
assertEqual
(
paysheet
.
getPriceCurrencyValue
(),
currency
)
self
.
assertEqual
(
paysheet
.
getDefaultPaymentConditionTradeDate
(),
'custom'
)
self
.
assertEqual
(
paysheet
.
getDefaultPaymentConditionPaymentDate
(),
DateTime
(
2009
,
0
5
,
25
))
DateTime
(
2009
,
5
,
25
))
self
.
assertEqual
(
paysheet
.
getWorkTimeAnnotationLineQuantity
(),
151.67
)
self
.
assertEqual
(
paysheet
.
getWorkTimeAnnotationLineQuantityUnit
(),
'time/hours'
)
...
...
@@ -1633,7 +1633,7 @@ class TestPayrollMixin(TestTradeModelLineMixin, ERP5ReportTestCase):
variation_settings_category_list
=
[
'salary_range/france'
,],
reference
=
'fabien_model_2009'
,
effective_date
=
DateTime
(
2009
,
1
,
1
),
expiration_date
=
DateTime
(
2009
,
0
6
,
30
))
expiration_date
=
DateTime
(
2009
,
6
,
30
))
model_1
.
validate
()
model_2
=
self
.
getPortalObject
().
paysheet_model_module
.
newContent
(
\
...
...
@@ -1641,7 +1641,7 @@ class TestPayrollMixin(TestTradeModelLineMixin, ERP5ReportTestCase):
portal_type
=
'Pay Sheet Model'
,
variation_settings_category_list
=
[
'salary_range/france'
,],
reference
=
'fabien_model_2009'
,
effective_date
=
DateTime
(
2009
,
0
7
,
1
),
effective_date
=
DateTime
(
2009
,
7
,
1
),
expiration_date
=
DateTime
(
2009
,
12
,
31
))
model_2
.
validate
()
...
...
@@ -1672,8 +1672,8 @@ class TestPayrollMixin(TestTradeModelLineMixin, ERP5ReportTestCase):
paysheet
=
self
.
portal
.
accounting_module
.
newContent
(
portal_type
=
'Pay Sheet Transaction'
,
specialise_value
=
model_1
,
start_date
=
DateTime
(
2009
,
0
7
,
1
),
stop_date
=
DateTime
(
2009
,
0
7
,
31
),
start_date
=
DateTime
(
2009
,
7
,
1
),
stop_date
=
DateTime
(
2009
,
7
,
31
),
price_currency_value
=
eur
)
paysheet
.
PaySheetTransaction_applyModel
()
self
.
tic
()
...
...
@@ -1701,8 +1701,8 @@ class TestPayrollMixin(TestTradeModelLineMixin, ERP5ReportTestCase):
portal_type
=
'Pay Sheet Model'
,
variation_settings_category_list
=
[
'salary_range/france'
,],
reference
=
'fabien_model_2009'
,
effective_date
=
DateTime
(
2009
,
0
1
,
1
),
expiration_date
=
DateTime
(
2009
,
0
2
,
28
),
effective_date
=
DateTime
(
2009
,
1
,
1
),
expiration_date
=
DateTime
(
2009
,
2
,
28
),
specialise_value
=
sequence
.
get
(
'business_process'
))
model_1
.
validate
()
...
...
@@ -1712,7 +1712,7 @@ class TestPayrollMixin(TestTradeModelLineMixin, ERP5ReportTestCase):
portal_type
=
'Pay Sheet Model'
,
variation_settings_category_list
=
[
'salary_range/france'
,],
reference
=
'fabien_model_2009'
,
effective_date
=
DateTime
(
2009
,
0
7
,
1
),
effective_date
=
DateTime
(
2009
,
7
,
1
),
expiration_date
=
DateTime
(
2009
,
12
,
31
),
version
=
'002'
,
specialise_value
=
sequence
.
get
(
'business_process'
))
...
...
@@ -1722,7 +1722,7 @@ class TestPayrollMixin(TestTradeModelLineMixin, ERP5ReportTestCase):
portal_type
=
'Pay Sheet Model'
,
variation_settings_category_list
=
[
'salary_range/france'
,],
reference
=
'fabien_model_2009'
,
effective_date
=
DateTime
(
2009
,
0
7
,
1
),
effective_date
=
DateTime
(
2009
,
7
,
1
),
expiration_date
=
DateTime
(
2009
,
12
,
31
),
version
=
'001'
,
specialise_value
=
sequence
.
get
(
'business_process'
))
...
...
@@ -1733,8 +1733,8 @@ class TestPayrollMixin(TestTradeModelLineMixin, ERP5ReportTestCase):
paysheet
=
self
.
portal
.
accounting_module
.
newContent
(
portal_type
=
'Pay Sheet Transaction'
,
specialise_value
=
model_1
,
start_date
=
DateTime
(
2009
,
0
7
,
1
),
stop_date
=
DateTime
(
2009
,
0
7
,
31
),
start_date
=
DateTime
(
2009
,
7
,
1
),
stop_date
=
DateTime
(
2009
,
7
,
31
),
price_currency_value
=
eur
)
paysheet
.
PaySheetTransaction_applyModel
()
self
.
tic
()
...
...
@@ -1796,8 +1796,8 @@ class TestPayrollMixin(TestTradeModelLineMixin, ERP5ReportTestCase):
portal_type
=
'Pay Sheet Model'
,
specialise_value
=
sequence
.
get
(
'business_process'
),
reference
=
'fabien_model_2009'
,
effective_date
=
DateTime
(
2009
,
0
1
,
1
),
expiration_date
=
DateTime
(
2009
,
0
2
,
28
))
effective_date
=
DateTime
(
2009
,
1
,
1
),
expiration_date
=
DateTime
(
2009
,
2
,
28
))
model_line_1
=
self
.
createModelLine
(
model_1
)
model_line_1
.
edit
(
resource_value
=
labour
,
...
...
@@ -1812,7 +1812,7 @@ class TestPayrollMixin(TestTradeModelLineMixin, ERP5ReportTestCase):
portal_type
=
'Pay Sheet Model'
,
specialise_value
=
sequence
.
get
(
'business_process'
),
reference
=
'fabien_model_2009'
,
effective_date
=
DateTime
(
2009
,
0
7
,
1
),
effective_date
=
DateTime
(
2009
,
7
,
1
),
expiration_date
=
DateTime
(
2009
,
12
,
31
),
version
=
'002'
)
model_line_2
=
self
.
createModelLine
(
model_2
)
...
...
@@ -1827,7 +1827,7 @@ class TestPayrollMixin(TestTradeModelLineMixin, ERP5ReportTestCase):
portal_type
=
'Pay Sheet Model'
,
specialise_value
=
sequence
.
get
(
'business_process'
),
reference
=
'fabien_model_2009'
,
effective_date
=
DateTime
(
2009
,
0
7
,
1
),
effective_date
=
DateTime
(
2009
,
7
,
1
),
expiration_date
=
DateTime
(
2009
,
12
,
31
),
version
=
'001'
)
model_line_3
=
self
.
createModelLine
(
model_3
)
...
...
@@ -1844,8 +1844,8 @@ class TestPayrollMixin(TestTradeModelLineMixin, ERP5ReportTestCase):
portal_type
=
'Pay Sheet Model'
,
specialise_value
=
sequence
.
get
(
'business_process'
),
reference
=
'fabien_model_level_2_2009'
,
effective_date
=
DateTime
(
2009
,
0
1
,
1
),
expiration_date
=
DateTime
(
2009
,
0
6
,
30
),
effective_date
=
DateTime
(
2009
,
1
,
1
),
expiration_date
=
DateTime
(
2009
,
6
,
30
),
version
=
'002'
)
model_line_4
=
self
.
createModelLine
(
model_4
)
model_line_4
.
edit
(
...
...
@@ -1859,7 +1859,7 @@ class TestPayrollMixin(TestTradeModelLineMixin, ERP5ReportTestCase):
portal_type
=
'Pay Sheet Model'
,
specialise_value
=
sequence
.
get
(
'business_process'
),
reference
=
'fabien_model_level_2_2009'
,
effective_date
=
DateTime
(
2009
,
0
7
,
1
),
effective_date
=
DateTime
(
2009
,
7
,
1
),
expiration_date
=
DateTime
(
2009
,
12
,
31
),
version
=
'001'
)
model_line_5
=
self
.
createModelLine
(
model_5
)
...
...
@@ -1876,8 +1876,8 @@ class TestPayrollMixin(TestTradeModelLineMixin, ERP5ReportTestCase):
portal_type
=
'Pay Sheet Model'
,
specialise_value
=
sequence
.
get
(
'business_process'
),
reference
=
'fabien_model_level_3_2009'
,
effective_date
=
DateTime
(
2009
,
0
1
,
1
),
expiration_date
=
DateTime
(
2009
,
0
6
,
30
),
effective_date
=
DateTime
(
2009
,
1
,
1
),
expiration_date
=
DateTime
(
2009
,
6
,
30
),
version
=
'002'
)
model_line_6
=
self
.
createModelLine
(
model_6
)
model_line_6
.
edit
(
...
...
@@ -1891,7 +1891,7 @@ class TestPayrollMixin(TestTradeModelLineMixin, ERP5ReportTestCase):
portal_type
=
'Pay Sheet Model'
,
specialise_value
=
sequence
.
get
(
'business_process'
),
reference
=
'fabien_model_level_3_2009'
,
effective_date
=
DateTime
(
2009
,
0
7
,
1
),
effective_date
=
DateTime
(
2009
,
7
,
1
),
expiration_date
=
DateTime
(
2009
,
12
,
31
),
version
=
'001'
)
model_line_7
=
self
.
createModelLine
(
model_7
)
...
...
@@ -1907,7 +1907,7 @@ class TestPayrollMixin(TestTradeModelLineMixin, ERP5ReportTestCase):
portal_type
=
'Pay Sheet Model'
,
specialise_value
=
sequence
.
get
(
'business_process'
),
reference
=
'fabien_model_level_3_2009'
,
effective_date
=
DateTime
(
2009
,
0
7
,
1
),
effective_date
=
DateTime
(
2009
,
7
,
1
),
expiration_date
=
DateTime
(
2009
,
12
,
31
),
version
=
'001'
)
...
...
@@ -1917,8 +1917,8 @@ class TestPayrollMixin(TestTradeModelLineMixin, ERP5ReportTestCase):
paysheet
=
self
.
portal
.
accounting_module
.
newContent
(
portal_type
=
'Pay Sheet Transaction'
,
specialise_value
=
model_1
,
start_date
=
DateTime
(
2009
,
0
7
,
1
),
stop_date
=
DateTime
(
2009
,
0
7
,
31
),
start_date
=
DateTime
(
2009
,
7
,
1
),
stop_date
=
DateTime
(
2009
,
7
,
31
),
price_currency_value
=
eur
)
specialise_value
=
paysheet
.
getSpecialiseValue
()
...
...
bt5/erp5_payroll_l10n_fr/TestTemplateItem/portal_components/test.erp5.testDSNSocialDeclarationReport.py
View file @
9a98dbbc
...
...
@@ -46,7 +46,7 @@ class TestDSNSocialDeclarationReport(ERP5TypeTestCase):
"""
self
.
dsn_module
=
self
.
portal
.
getDefaultModuleValue
(
"DSN Monthly Report"
)
self
.
setTimeZoneToUTC
()
self
.
pinDateTime
(
DateTime
(
2015
,
12
,
0
1
))
self
.
pinDateTime
(
DateTime
(
2015
,
12
,
1
))
# Create the id_group 'dsn_event_counter'
self
.
portal
.
portal_ids
.
generateNewId
(
id_group
=
'dsn_event_counter'
,
id_generator
=
'continuous_integer_increasing'
)
...
...
bt5/erp5_simplified_invoicing/TestTemplateItem/portal_components/test.erp5.testInvoice.py
View file @
9a98dbbc
...
...
@@ -281,16 +281,16 @@ class TestInvoice(TestInvoiceMixin):
self
.
assertEqual
(
other_resource
,
invoice_movement
.
getResourceValue
())
order_line
.
setStartDate
(
DateTime
(
2001
,
02
,
0
3
))
order_line
.
setStartDate
(
DateTime
(
2001
,
2
,
3
))
self
.
tic
()
invoice_movement
=
invoice_applied_rule
.
contentValues
()[
0
]
self
.
assertEqual
(
DateTime
(
2001
,
02
,
0
3
),
self
.
assertEqual
(
DateTime
(
2001
,
2
,
3
),
invoice_movement
.
getStartDate
())
order_line
.
setStopDate
(
DateTime
(
2002
,
03
,
0
4
))
order_line
.
setStopDate
(
DateTime
(
2002
,
3
,
4
))
self
.
tic
()
invoice_movement
=
invoice_applied_rule
.
contentValues
()[
0
]
self
.
assertEqual
(
DateTime
(
2002
,
03
,
0
4
),
self
.
assertEqual
(
DateTime
(
2002
,
3
,
4
),
invoice_movement
.
getStopDate
())
@
newSimulationExpectedFailure
...
...
@@ -478,20 +478,20 @@ class TestInvoice(TestInvoiceMixin):
self
.
assertEqual
(
456
,
invoice_transaction_movement
.
getQuantity
())
order_line
.
setStartDate
(
DateTime
(
2001
,
02
,
0
3
))
order_line
.
setStartDate
(
DateTime
(
2001
,
2
,
3
))
self
.
tic
()
self
.
assertEqual
(
3
,
len
(
invoice_transaction_applied_rule
))
invoice_transaction_movement
=
getIncomeSimulationMovement
(
invoice_transaction_applied_rule
)
self
.
assertEqual
(
DateTime
(
2001
,
02
,
0
3
),
self
.
assertEqual
(
DateTime
(
2001
,
2
,
3
),
invoice_transaction_movement
.
getStartDate
())
order_line
.
setStopDate
(
DateTime
(
2002
,
03
,
0
4
))
order_line
.
setStopDate
(
DateTime
(
2002
,
3
,
4
))
self
.
tic
()
self
.
assertEqual
(
3
,
len
(
invoice_transaction_applied_rule
))
invoice_transaction_movement
=
getIncomeSimulationMovement
(
invoice_transaction_applied_rule
)
self
.
assertEqual
(
DateTime
(
2002
,
03
,
0
4
),
self
.
assertEqual
(
DateTime
(
2002
,
3
,
4
),
invoice_transaction_movement
.
getStopDate
())
def
test_Invoice_viewAsODT
(
self
):
...
...
bt5/erp5_simplified_invoicing/TestTemplateItem/portal_components/test.erp5.testTradeCondition.py
View file @
9a98dbbc
...
...
@@ -162,10 +162,10 @@ class TestApplyTradeCondition(TradeConditionTestCase):
def
test_apply_trade_condition_with_payment_conditions
(
self
):
self
.
trade_condition
.
setPaymentConditionTradeDate
(
'custom'
)
self
.
trade_condition
.
setPaymentConditionPaymentDate
(
DateTime
(
2001
,
01
,
0
1
))
self
.
trade_condition
.
setPaymentConditionPaymentDate
(
DateTime
(
2001
,
1
,
1
))
self
.
order
.
setSpecialiseValue
(
self
.
trade_condition
)
self
.
assertEqual
(
'custom'
,
self
.
order
.
asComposedDocument
().
getProperty
(
'payment_condition_trade_date'
))
self
.
assertEqual
(
DateTime
(
2001
,
01
,
0
1
),
self
.
assertEqual
(
DateTime
(
2001
,
1
,
1
),
self
.
order
.
asComposedDocument
().
getProperty
(
'payment_condition_payment_date'
))
def
test_apply_trade_condition_with_payment_conditions_with_hierarchy
(
self
):
...
...
@@ -174,12 +174,12 @@ class TestApplyTradeCondition(TradeConditionTestCase):
title
=
'Other Trade Condition'
)
other_trade_condition
.
setPaymentConditionTradeDate
(
'custom'
)
other_trade_condition
.
setPaymentConditionPaymentDate
(
DateTime
(
2001
,
01
,
0
1
))
DateTime
(
2001
,
1
,
1
))
self
.
trade_condition
.
setSpecialiseValue
(
other_trade_condition
)
self
.
order
.
setSpecialiseValue
(
self
.
trade_condition
)
self
.
assertEqual
(
'custom'
,
self
.
order
.
asComposedDocument
().
getProperty
(
'payment_condition_trade_date'
))
self
.
assertEqual
(
DateTime
(
2001
,
01
,
0
1
),
self
.
assertEqual
(
DateTime
(
2001
,
1
,
1
),
self
.
order
.
asComposedDocument
().
getProperty
(
'payment_condition_payment_date'
))
def
test_apply_trade_condition_twice_update_order
(
self
):
...
...
@@ -189,7 +189,7 @@ class TestApplyTradeCondition(TradeConditionTestCase):
self
.
trade_condition
.
setDestinationValue
(
self
.
client
)
self
.
trade_condition
.
setPriceCurrencyValue
(
self
.
currency
)
self
.
trade_condition
.
setPaymentConditionTradeDate
(
'custom'
)
self
.
trade_condition
.
setPaymentConditionPaymentDate
(
DateTime
(
2001
,
01
,
0
1
))
self
.
trade_condition
.
setPaymentConditionPaymentDate
(
DateTime
(
2001
,
1
,
1
))
self
.
order
.
setSpecialiseValue
(
self
.
trade_condition
)
self
.
order
.
Order_applyTradeCondition
(
self
.
trade_condition
,
force
=
1
)
...
...
@@ -201,7 +201,7 @@ class TestApplyTradeCondition(TradeConditionTestCase):
self
.
assertEqual
(
self
.
client
,
self
.
order
.
getDestinationValue
())
self
.
assertEqual
(
self
.
currency
,
self
.
order
.
getPriceCurrencyValue
())
self
.
assertEqual
(
'custom'
,
self
.
order
.
asComposedDocument
().
getProperty
(
'payment_condition_trade_date'
))
self
.
assertEqual
(
DateTime
(
2001
,
01
,
0
1
),
self
.
assertEqual
(
DateTime
(
2001
,
1
,
1
),
self
.
order
.
asComposedDocument
().
getProperty
(
'payment_condition_payment_date'
))
new_vendor
=
self
.
portal
.
organisation_module
.
newContent
(
...
...
@@ -221,7 +221,7 @@ class TestApplyTradeCondition(TradeConditionTestCase):
self
.
assertEqual
(
self
.
client
,
self
.
order
.
getDestinationValue
())
self
.
assertEqual
(
self
.
currency
,
self
.
order
.
getPriceCurrencyValue
())
self
.
assertEqual
(
'custom'
,
self
.
order
.
asComposedDocument
().
getProperty
(
'payment_condition_trade_date'
))
self
.
assertEqual
(
DateTime
(
2002
,
02
,
0
2
),
self
.
assertEqual
(
DateTime
(
2002
,
2
,
2
),
self
.
order
.
asComposedDocument
().
getProperty
(
'payment_condition_payment_date'
))
...
...
bt5/erp5_tiosafe_core/ModuleComponentTemplateItem/portal_components/module.erp5.ERP5NodeConduit.py
View file @
9a98dbbc
...
...
@@ -61,7 +61,7 @@ class ERP5NodeConduit(TioSafeBaseConduit):
destination
=
object
.
getRelativeUrl
(),
destination_decision
=
object
.
getRelativeUrl
(),
destination_administration
=
object
.
getRelativeUrl
(),
version
=
001
)
version
=
0
o
01
)
stc
.
validate
()
def
_updateSaleTradeCondition
(
self
,
object
,
**
kw
):
# pylint: disable=redefined-builtin
...
...
bt5/erp5_tiosafe_core/ModuleComponentTemplateItem/portal_components/module.erp5.ERP5PaymentTransactionConduit.py
View file @
9a98dbbc
...
...
@@ -78,7 +78,7 @@ class ERP5PaymentTransactionConduit(TioSafeBaseConduit):
# Create the STC
stc
=
object
.
getPortalObject
().
sale_trade_condition_module
.
newContent
(
title
=
stc_title
,
specialise
=
default_stc
,
version
=
001
)
version
=
0
o
01
)
stc
.
validate
()
return
stc
...
...
bt5/erp5_trade/TestTemplateItem/portal_components/test.erp5.testInventoryModule.py
View file @
9a98dbbc
...
...
@@ -627,7 +627,7 @@ class TestInventoryModule(TestOrderMixin, ERP5TypeTestCase):
specialise
=
self
.
business_process
,
source_value
=
from_organisation
,
destination_value
=
organisation
,
start_date
=
DateTime
(
2019
,
0
2
,
20
),
start_date
=
DateTime
(
2019
,
2
,
20
),
)
resource_value
=
sequence
.
get
(
'resource'
)
delivery
.
newContent
(
portal_type
=
'Internal Packing List Line'
,
...
...
@@ -649,7 +649,7 @@ class TestInventoryModule(TestOrderMixin, ERP5TypeTestCase):
self
.
assertEqual
(
2
,
getInventoryQuantity
())
inventory
=
self
.
getInventoryModule
().
newContent
()
inventory
.
edit
(
start_date
=
DateTime
(
2019
,
0
2
,
21
),
inventory
.
edit
(
start_date
=
DateTime
(
2019
,
2
,
21
),
destination_value
=
organisation
,
full_inventory
=
True
)
inventory
.
deliver
()
...
...
@@ -694,7 +694,7 @@ class TestInventoryModule(TestOrderMixin, ERP5TypeTestCase):
self
.
assertEqual
(
2
,
getInventoryQuantity
())
inventory
=
self
.
getInventoryModule
().
newContent
()
inventory
.
edit
(
start_date
=
DateTime
(
2019
,
0
2
,
21
),
inventory
.
edit
(
start_date
=
DateTime
(
2019
,
2
,
21
),
destination_value
=
organisation
,
full_inventory
=
True
)
inventory_line
=
inventory
.
newContent
(
portal_type
=
'Inventory Line'
,
...
...
bt5/erp5_web_service/DocumentTemplateItem/portal_components/document.erp5.FTPConnector.py
View file @
9a98dbbc
...
...
@@ -125,7 +125,7 @@ class FTPConnector(XMLObject):
finally
:
conn
.
logout
()
def
createDirectory
(
self
,
path
,
mode
=
0777
):
def
createDirectory
(
self
,
path
,
mode
=
0
o
777
):
"""Create a directory `path`, with file mode `mode`.
The directory is created immediatly, even if transaction is aborted.
...
...
bt5/erp5_web_service/ModuleComponentTemplateItem/portal_components/module.erp5.SFTPConnection.py
View file @
9a98dbbc
...
...
@@ -171,7 +171,7 @@ class SFTPConnection:
raise
SFTPError
(
'%s while trying to rename "%s" to "%s" on %s.'
%
\
(
str
(
msg
),
old_path
,
new_path
,
self
.
url
))
def
createDirectory
(
self
,
path
,
mode
=
0777
):
def
createDirectory
(
self
,
path
,
mode
=
0
o
777
):
"""Create a directory `path` with mode `mode`.
"""
return
self
.
conn
.
mkdir
(
path
,
mode
)
...
...
product/ERP5/tests/testInventoryAPI.py
View file @
9a98dbbc
...
...
@@ -1960,94 +1960,94 @@ class TestMovementHistoryList(InventoryAPITestCase):
def
test_FromDate
(
self
):
getMovementHistoryList
=
self
.
getSimulationTool
().
getMovementHistoryList
for
date
in
[
DateTime
(
2006
,
0
1
,
day
)
for
day
in
range
(
1
,
4
)]:
for
date
in
[
DateTime
(
2006
,
1
,
day
)
for
day
in
range
(
1
,
4
)]:
self
.
_makeMovement
(
quantity
=
100
,
start_date
=
date
,
stop_date
=
date
+
1
)
# from_date takes all movements >=
self
.
assertEqual
(
len
(
getMovementHistoryList
(
from_date
=
DateTime
(
2006
,
01
,
0
3
),
from_date
=
DateTime
(
2006
,
1
,
3
),
section_uid
=
self
.
section
.
getUid
())),
2
)
self
.
assertEqual
(
len
(
getMovementHistoryList
(
from_date
=
DateTime
(
2006
,
01
,
0
2
),
from_date
=
DateTime
(
2006
,
1
,
2
),
section_uid
=
self
.
mirror_section
.
getUid
())),
2
)
def
test_AtDate
(
self
):
getMovementHistoryList
=
self
.
getSimulationTool
().
getMovementHistoryList
for
date
in
[
DateTime
(
2006
,
0
1
,
day
)
for
day
in
range
(
1
,
4
)]:
for
date
in
[
DateTime
(
2006
,
1
,
day
)
for
day
in
range
(
1
,
4
)]:
self
.
_makeMovement
(
quantity
=
100
,
start_date
=
date
,
stop_date
=
date
+
1
)
# at_date takes all movements <=
self
.
assertEqual
(
len
(
getMovementHistoryList
(
at_date
=
DateTime
(
2006
,
01
,
0
3
),
at_date
=
DateTime
(
2006
,
1
,
3
),
section_uid
=
self
.
section
.
getUid
())),
2
)
self
.
assertEqual
(
len
(
getMovementHistoryList
(
at_date
=
DateTime
(
2006
,
01
,
0
2
),
at_date
=
DateTime
(
2006
,
1
,
2
),
section_uid
=
self
.
mirror_section
.
getUid
())),
2
)
def
test_ToDate
(
self
):
getMovementHistoryList
=
self
.
getSimulationTool
().
getMovementHistoryList
for
date
in
[
DateTime
(
2006
,
0
1
,
day
)
for
day
in
range
(
1
,
4
)]:
for
date
in
[
DateTime
(
2006
,
1
,
day
)
for
day
in
range
(
1
,
4
)]:
self
.
_makeMovement
(
quantity
=
100
,
start_date
=
date
,
stop_date
=
date
+
1
)
# to_date takes all movements <
self
.
assertEqual
(
len
(
getMovementHistoryList
(
to_date
=
DateTime
(
2006
,
01
,
0
3
),
to_date
=
DateTime
(
2006
,
1
,
3
),
section_uid
=
self
.
section
.
getUid
())),
1
)
self
.
assertEqual
(
len
(
getMovementHistoryList
(
to_date
=
DateTime
(
2006
,
01
,
0
2
),
to_date
=
DateTime
(
2006
,
1
,
2
),
section_uid
=
self
.
mirror_section
.
getUid
())),
1
)
def
test_FromDateAtDate
(
self
):
getMovementHistoryList
=
self
.
getSimulationTool
().
getMovementHistoryList
for
date
in
[
DateTime
(
2006
,
0
1
,
day
)
for
day
in
range
(
1
,
4
)]:
for
date
in
[
DateTime
(
2006
,
1
,
day
)
for
day
in
range
(
1
,
4
)]:
self
.
_makeMovement
(
quantity
=
100
,
start_date
=
date
,
stop_date
=
date
+
1
)
# both from_date and at_date
self
.
assertEqual
(
len
(
getMovementHistoryList
(
from_date
=
DateTime
(
2006
,
01
,
0
3
),
at_date
=
DateTime
(
2006
,
01
,
0
3
),
from_date
=
DateTime
(
2006
,
1
,
3
),
at_date
=
DateTime
(
2006
,
1
,
3
),
section_uid
=
self
.
section
.
getUid
())),
1
)
self
.
assertEqual
(
len
(
getMovementHistoryList
(
from_date
=
DateTime
(
2006
,
01
,
0
2
),
at_date
=
DateTime
(
2006
,
01
,
0
3
),
from_date
=
DateTime
(
2006
,
1
,
2
),
at_date
=
DateTime
(
2006
,
1
,
3
),
section_uid
=
self
.
section
.
getUid
())),
2
)
self
.
assertEqual
(
len
(
getMovementHistoryList
(
from_date
=
DateTime
(
2005
,
01
,
0
2
),
at_date
=
DateTime
(
2006
,
01
,
0
3
),
from_date
=
DateTime
(
2005
,
1
,
2
),
at_date
=
DateTime
(
2006
,
1
,
3
),
section_uid
=
self
.
section
.
getUid
())),
2
)
# from other side
self
.
assertEqual
(
len
(
getMovementHistoryList
(
from_date
=
DateTime
(
2006
,
01
,
0
2
),
at_date
=
DateTime
(
2006
,
01
,
0
3
),
from_date
=
DateTime
(
2006
,
1
,
2
),
at_date
=
DateTime
(
2006
,
1
,
3
),
section_uid
=
self
.
mirror_section
.
getUid
())),
2
)
def
test_FromDateToDate
(
self
):
getMovementHistoryList
=
self
.
getSimulationTool
().
getMovementHistoryList
for
date
in
[
DateTime
(
2006
,
0
1
,
day
)
for
day
in
range
(
1
,
4
)]:
for
date
in
[
DateTime
(
2006
,
1
,
day
)
for
day
in
range
(
1
,
4
)]:
self
.
_makeMovement
(
quantity
=
100
,
start_date
=
date
,
stop_date
=
date
+
1
)
# both from_date and to_date
self
.
assertEqual
(
len
(
getMovementHistoryList
(
from_date
=
DateTime
(
2006
,
01
,
0
3
),
to_date
=
DateTime
(
2006
,
01
,
0
3
),
from_date
=
DateTime
(
2006
,
1
,
3
),
to_date
=
DateTime
(
2006
,
1
,
3
),
section_uid
=
self
.
section
.
getUid
())),
0
)
self
.
assertEqual
(
len
(
getMovementHistoryList
(
from_date
=
DateTime
(
2006
,
01
,
0
2
),
to_date
=
DateTime
(
2006
,
01
,
0
3
),
from_date
=
DateTime
(
2006
,
1
,
2
),
to_date
=
DateTime
(
2006
,
1
,
3
),
section_uid
=
self
.
section
.
getUid
())),
1
)
self
.
assertEqual
(
len
(
getMovementHistoryList
(
from_date
=
DateTime
(
2005
,
01
,
0
2
),
to_date
=
DateTime
(
2007
,
01
,
0
2
),
from_date
=
DateTime
(
2005
,
1
,
2
),
to_date
=
DateTime
(
2007
,
1
,
2
),
section_uid
=
self
.
section
.
getUid
())),
3
)
# from other side
self
.
assertEqual
(
len
(
getMovementHistoryList
(
from_date
=
DateTime
(
2006
,
01
,
0
2
),
to_date
=
DateTime
(
2006
,
01
,
0
3
),
from_date
=
DateTime
(
2006
,
1
,
2
),
to_date
=
DateTime
(
2006
,
1
,
3
),
section_uid
=
self
.
mirror_section
.
getUid
())),
1
)
...
...
@@ -2085,7 +2085,7 @@ class TestMovementHistoryList(InventoryAPITestCase):
def
test_SortOnDate
(
self
):
getMovementHistoryList
=
self
.
getSimulationTool
().
getMovementHistoryList
date_list
=
[
DateTime
(
2006
,
0
1
,
day
)
for
day
in
range
(
1
,
10
)]
date_list
=
[
DateTime
(
2006
,
1
,
day
)
for
day
in
range
(
1
,
10
)]
reverse_date_list
=
date_list
[:]
reverse_date_list
.
reverse
()
...
...
@@ -2194,7 +2194,7 @@ class TestMovementHistoryList(InventoryAPITestCase):
"""Test that a running_total_quantity attribute is set on brains
"""
getMovementHistoryList
=
self
.
getSimulationTool
().
getMovementHistoryList
date_and_qty_list
=
[(
DateTime
(
2006
,
0
1
,
day
),
day
)
for
day
in
range
(
1
,
10
)]
date_and_qty_list
=
[(
DateTime
(
2006
,
1
,
day
),
day
)
for
day
in
range
(
1
,
10
)]
for
date
,
quantity
in
date_and_qty_list
:
self
.
_makeMovement
(
stop_date
=
date
,
quantity
=
quantity
)
movement_history_list
=
getMovementHistoryList
(
...
...
@@ -2213,7 +2213,7 @@ class TestMovementHistoryList(InventoryAPITestCase):
"""Test that a running_total_price attribute is set on brains
"""
getMovementHistoryList
=
self
.
getSimulationTool
().
getMovementHistoryList
date_and_price_list
=
[(
DateTime
(
2006
,
0
1
,
day
),
day
)
for
day
in
range
(
1
,
10
)]
date_and_price_list
=
[(
DateTime
(
2006
,
1
,
day
),
day
)
for
day
in
range
(
1
,
10
)]
for
date
,
price
in
date_and_price_list
:
self
.
_makeMovement
(
stop_date
=
date
,
quantity
=
1
,
price
=
price
)
movement_history_list
=
getMovementHistoryList
(
...
...
@@ -2233,7 +2233,7 @@ class TestMovementHistoryList(InventoryAPITestCase):
value.
"""
getMovementHistoryList
=
self
.
getSimulationTool
().
getMovementHistoryList
date_and_qty_list
=
[(
DateTime
(
2006
,
0
1
,
day
),
day
)
for
day
in
range
(
1
,
10
)]
date_and_qty_list
=
[(
DateTime
(
2006
,
1
,
day
),
day
)
for
day
in
range
(
1
,
10
)]
for
date
,
quantity
in
date_and_qty_list
:
self
.
_makeMovement
(
stop_date
=
date
,
price
=
quantity
,
quantity
=
quantity
)
initial_running_total_price
=
100
...
...
product/ERP5Type/tests/Python3StyleTest.py
View file @
9a98dbbc
...
...
@@ -84,6 +84,10 @@ class Python3StyleTest(ERP5TypeTestCase):
def
test_hasKeyFixApplied
(
self
):
self
.
_testFixer
(
'has_key'
)
def
test_numliteralsFixApplied
(
self
):
self
.
_testFixer
(
'numliterals'
)
def
test_suite
():
suite
=
unittest
.
TestSuite
()
tested_product
=
os
.
environ
[
'TESTED_PRODUCT'
]
...
...
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