Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
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
Carlos Ramos Carreño
slapos.core
Commits
3b4d4028
Commit
3b4d4028
authored
Apr 16, 2024
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
py3: 2to3 -j 20 --write --nobackups --no-diffs --fix=asserts master
parent
0ede1d85
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
54 deletions
+54
-54
master/bt5/slapos_accounting/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5AccountingScenario.py
..._components/test.erp5.testSlapOSERP5AccountingScenario.py
+23
-23
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudSkins.py
...eItem/portal_components/test.erp5.testSlapOSCloudSkins.py
+13
-13
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5CRMScenario.py
.../portal_components/test.erp5.testSlapOSERP5CRMScenario.py
+18
-18
No files found.
master/bt5/slapos_accounting/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5AccountingScenario.py
View file @
3b4d4028
...
@@ -40,8 +40,8 @@ class TestSlapOSAccountingScenario(TestSlapOSVirtualMasterScenarioMixin):
...
@@ -40,8 +40,8 @@ class TestSlapOSAccountingScenario(TestSlapOSVirtualMasterScenarioMixin):
self
.
assertTrue
(
owner_person
.
Entity_hasOutstandingAmount
(
include_planned
=
True
))
self
.
assertTrue
(
owner_person
.
Entity_hasOutstandingAmount
(
include_planned
=
True
))
amount_list
=
owner_person
.
Entity_getOutstandingAmountList
(
include_planned
=
True
)
amount_list
=
owner_person
.
Entity_getOutstandingAmountList
(
include_planned
=
True
)
self
.
assertEqual
s
(
len
(
amount_list
),
1
)
self
.
assertEqual
(
len
(
amount_list
),
1
)
self
.
assertEqual
s
(
amount_list
[
0
].
total_price
,
24.384
)
self
.
assertEqual
(
amount_list
[
0
].
total_price
,
24.384
)
self
.
assertFalse
(
owner_person
.
Entity_hasOutstandingAmount
())
self
.
assertFalse
(
owner_person
.
Entity_hasOutstandingAmount
())
self
.
assertEqual
(
subscription_request
.
getSimulationState
(),
"invalidated"
)
self
.
assertEqual
(
subscription_request
.
getSimulationState
(),
"invalidated"
)
open_sale_order
=
self
.
portal
.
portal_catalog
.
getResultValue
(
open_sale_order
=
self
.
portal
.
portal_catalog
.
getResultValue
(
...
@@ -80,12 +80,12 @@ class TestSlapOSAccountingScenario(TestSlapOSVirtualMasterScenarioMixin):
...
@@ -80,12 +80,12 @@ class TestSlapOSAccountingScenario(TestSlapOSVirtualMasterScenarioMixin):
self
.
assertTrue
(
owner_person
.
Entity_hasOutstandingAmount
(
include_planned
=
True
))
self
.
assertTrue
(
owner_person
.
Entity_hasOutstandingAmount
(
include_planned
=
True
))
amount_list
=
owner_person
.
Entity_getOutstandingAmountList
(
include_planned
=
True
)
amount_list
=
owner_person
.
Entity_getOutstandingAmountList
(
include_planned
=
True
)
self
.
assertEqual
s
(
len
(
amount_list
),
1
)
self
.
assertEqual
(
len
(
amount_list
),
1
)
self
.
assertEqual
s
(
amount_list
[
0
].
total_price
,
175.584
)
self
.
assertEqual
(
amount_list
[
0
].
total_price
,
175.584
)
self
.
assertTrue
(
owner_person
.
Entity_hasOutstandingAmount
())
self
.
assertTrue
(
owner_person
.
Entity_hasOutstandingAmount
())
amount_list
=
owner_person
.
Entity_getOutstandingAmountList
()
amount_list
=
owner_person
.
Entity_getOutstandingAmountList
()
self
.
assertEqual
s
(
len
(
amount_list
),
1
)
self
.
assertEqual
(
len
(
amount_list
),
1
)
self
.
assertEqual
s
(
amount_list
[
0
].
total_price
,
125.184
)
self
.
assertEqual
(
amount_list
[
0
].
total_price
,
125.184
)
self
.
assertEqual
(
first_invoice
.
getSimulationState
(),
"stopped"
)
self
.
assertEqual
(
first_invoice
.
getSimulationState
(),
"stopped"
)
# Ensure no unexpected object has been created
# Ensure no unexpected object has been created
# 4 accounting transactions
# 4 accounting transactions
...
@@ -110,16 +110,16 @@ class TestSlapOSAccountingScenario(TestSlapOSVirtualMasterScenarioMixin):
...
@@ -110,16 +110,16 @@ class TestSlapOSAccountingScenario(TestSlapOSVirtualMasterScenarioMixin):
)
)
)
)
payment_transaction
.
stop
()
payment_transaction
.
stop
()
self
.
assertEqual
s
(
payment_transaction
.
AccountingTransaction_getTotalCredit
(),
74.78399999999999
)
self
.
assertEqual
(
payment_transaction
.
AccountingTransaction_getTotalCredit
(),
74.78399999999999
)
self
.
tic
()
self
.
tic
()
self
.
assertTrue
(
owner_person
.
Entity_hasOutstandingAmount
(
include_planned
=
True
))
self
.
assertTrue
(
owner_person
.
Entity_hasOutstandingAmount
(
include_planned
=
True
))
amount_list
=
owner_person
.
Entity_getOutstandingAmountList
(
include_planned
=
True
)
amount_list
=
owner_person
.
Entity_getOutstandingAmountList
(
include_planned
=
True
)
self
.
assertEqual
s
(
len
(
amount_list
),
1
)
self
.
assertEqual
(
len
(
amount_list
),
1
)
self
.
assertEqual
s
(
amount_list
[
0
].
total_price
,
100.8
)
self
.
assertEqual
(
amount_list
[
0
].
total_price
,
100.8
)
self
.
assertTrue
(
owner_person
.
Entity_hasOutstandingAmount
())
self
.
assertTrue
(
owner_person
.
Entity_hasOutstandingAmount
())
amount_list
=
owner_person
.
Entity_getOutstandingAmountList
()
amount_list
=
owner_person
.
Entity_getOutstandingAmountList
()
self
.
assertEqual
s
(
len
(
amount_list
),
1
)
self
.
assertEqual
(
len
(
amount_list
),
1
)
self
.
assertEqual
s
(
amount_list
[
0
].
total_price
,
50.4
)
self
.
assertEqual
(
amount_list
[
0
].
total_price
,
50.4
)
self
.
assertTrue
(
first_invoice
.
SaleInvoiceTransaction_isLettered
())
self
.
assertTrue
(
first_invoice
.
SaleInvoiceTransaction_isLettered
())
# Ensure no unexpected object has been created
# Ensure no unexpected object has been created
self
.
assertRelatedObjectCount
(
project
,
22
)
self
.
assertRelatedObjectCount
(
project
,
22
)
...
@@ -136,15 +136,15 @@ class TestSlapOSAccountingScenario(TestSlapOSVirtualMasterScenarioMixin):
...
@@ -136,15 +136,15 @@ class TestSlapOSAccountingScenario(TestSlapOSVirtualMasterScenarioMixin):
)
)
)
)
payment_transaction
.
stop
()
payment_transaction
.
stop
()
self
.
assertEqual
s
(
payment_transaction
.
AccountingTransaction_getTotalCredit
(),
50.4
)
self
.
assertEqual
(
payment_transaction
.
AccountingTransaction_getTotalCredit
(),
50.4
)
self
.
tic
()
self
.
tic
()
self
.
assertTrue
(
owner_person
.
Entity_hasOutstandingAmount
(
include_planned
=
True
))
self
.
assertTrue
(
owner_person
.
Entity_hasOutstandingAmount
(
include_planned
=
True
))
amount_list
=
owner_person
.
Entity_getOutstandingAmountList
(
include_planned
=
True
)
amount_list
=
owner_person
.
Entity_getOutstandingAmountList
(
include_planned
=
True
)
self
.
assertEqual
s
(
len
(
amount_list
),
1
)
self
.
assertEqual
(
len
(
amount_list
),
1
)
self
.
assertEqual
s
(
amount_list
[
0
].
total_price
,
50.4
)
self
.
assertEqual
(
amount_list
[
0
].
total_price
,
50.4
)
self
.
assertFalse
(
owner_person
.
Entity_hasOutstandingAmount
())
self
.
assertFalse
(
owner_person
.
Entity_hasOutstandingAmount
())
amount_list
=
owner_person
.
Entity_getOutstandingAmountList
()
amount_list
=
owner_person
.
Entity_getOutstandingAmountList
()
self
.
assertEqual
s
(
len
(
amount_list
),
0
)
self
.
assertEqual
(
len
(
amount_list
),
0
)
# Ensure no unexpected object has been created
# Ensure no unexpected object has been created
self
.
assertRelatedObjectCount
(
project
,
22
)
self
.
assertRelatedObjectCount
(
project
,
22
)
...
@@ -236,7 +236,7 @@ class TestSlapOSAccountingScenario(TestSlapOSVirtualMasterScenarioMixin):
...
@@ -236,7 +236,7 @@ class TestSlapOSAccountingScenario(TestSlapOSVirtualMasterScenarioMixin):
self
.
logout
()
self
.
logout
()
self
.
login
()
self
.
login
()
# Check that no activity has been triggered yet
# Check that no activity has been triggered yet
self
.
assertEqual
s
(
self
.
portal
.
portal_catalog
.
countResults
(
self
.
assertEqual
(
self
.
portal
.
portal_catalog
.
countResults
(
portal_type
=
'Compute Node'
,
portal_type
=
'Compute Node'
,
follow_up__uid
=
project
.
getUid
()
follow_up__uid
=
project
.
getUid
()
)[
0
][
0
],
0
)
)[
0
][
0
],
0
)
...
@@ -246,7 +246,7 @@ class TestSlapOSAccountingScenario(TestSlapOSVirtualMasterScenarioMixin):
...
@@ -246,7 +246,7 @@ class TestSlapOSAccountingScenario(TestSlapOSVirtualMasterScenarioMixin):
# 1 invoice for the compute node
# 1 invoice for the compute node
# per user:
# per user:
# 1 monthly invoice for products
# 1 monthly invoice for products
self
.
assertEqual
s
(
self
.
portal
.
portal_catalog
.
countResults
(
self
.
assertEqual
(
self
.
portal
.
portal_catalog
.
countResults
(
portal_type
=
'Sale Invoice Transaction'
,
portal_type
=
'Sale Invoice Transaction'
,
source_project__uid
=
project
.
getUid
()
source_project__uid
=
project
.
getUid
()
)[
0
][
0
],
1
+
len
(
person_list
))
)[
0
][
0
],
1
+
len
(
person_list
))
...
@@ -271,7 +271,7 @@ class TestSlapOSAccountingScenario(TestSlapOSVirtualMasterScenarioMixin):
...
@@ -271,7 +271,7 @@ class TestSlapOSAccountingScenario(TestSlapOSVirtualMasterScenarioMixin):
# Execute activities for all services
# Execute activities for all services
# To try detection bad activity tag dependencies
# To try detection bad activity tag dependencies
self
.
tic
()
self
.
tic
()
self
.
assertEqual
s
(
self
.
portal
.
portal_catalog
.
countResults
(
self
.
assertEqual
(
self
.
portal
.
portal_catalog
.
countResults
(
portal_type
=
'Sale Invoice Transaction'
,
portal_type
=
'Sale Invoice Transaction'
,
source_project__uid
=
project
.
getUid
()
source_project__uid
=
project
.
getUid
()
)[
0
][
0
],
1
+
len
(
person_list
))
)[
0
][
0
],
1
+
len
(
person_list
))
...
@@ -283,7 +283,7 @@ class TestSlapOSAccountingScenario(TestSlapOSVirtualMasterScenarioMixin):
...
@@ -283,7 +283,7 @@ class TestSlapOSAccountingScenario(TestSlapOSVirtualMasterScenarioMixin):
self
.
login
()
self
.
login
()
self
.
portal
.
portal_alarms
.
update_open_order_simulation
.
activeSense
()
self
.
portal
.
portal_alarms
.
update_open_order_simulation
.
activeSense
()
self
.
tic
()
self
.
tic
()
self
.
assertEqual
s
(
self
.
portal
.
portal_catalog
.
countResults
(
self
.
assertEqual
(
self
.
portal
.
portal_catalog
.
countResults
(
portal_type
=
'Sale Invoice Transaction'
,
portal_type
=
'Sale Invoice Transaction'
,
source_project__uid
=
project
.
getUid
()
source_project__uid
=
project
.
getUid
()
)[
0
][
0
],
(
1
+
len
(
person_list
))
*
3
)
)[
0
][
0
],
(
1
+
len
(
person_list
))
*
3
)
...
@@ -327,15 +327,15 @@ class TestSlapOSAccountingScenario(TestSlapOSVirtualMasterScenarioMixin):
...
@@ -327,15 +327,15 @@ class TestSlapOSAccountingScenario(TestSlapOSVirtualMasterScenarioMixin):
parent_uid
=
invoice
.
getUid
(),
parent_uid
=
invoice
.
getUid
(),
resource__uid
=
self
.
portal
.
service_module
.
slapos_tax
.
getUid
()
resource__uid
=
self
.
portal
.
service_module
.
slapos_tax
.
getUid
()
)
)
self
.
assertEqual
s
(
tax_line
.
getPrice
(),
0
)
self
.
assertEqual
(
tax_line
.
getPrice
(),
0
)
self
.
assertEqual
s
(
invoice
.
getTotalPrice
(),
42
)
self
.
assertEqual
(
invoice
.
getTotalPrice
(),
42
)
with
PinnedDateTime
(
self
,
creation_date
+
35
):
with
PinnedDateTime
(
self
,
creation_date
+
35
):
self
.
portal
.
portal_alarms
.
update_open_order_simulation
.
activeSense
()
self
.
portal
.
portal_alarms
.
update_open_order_simulation
.
activeSense
()
self
.
tic
()
self
.
tic
()
self
.
assertEqual
s
(
invoice
.
getTotalPrice
(),
42
)
self
.
assertEqual
(
invoice
.
getTotalPrice
(),
42
)
self
.
assertEqual
s
(
invoice
.
getSimulationState
(),
'stopped'
)
self
.
assertEqual
(
invoice
.
getSimulationState
(),
'stopped'
)
# Ensure no unexpected object has been created
# Ensure no unexpected object has been created
# 2 invoice lines
# 2 invoice lines
...
...
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudSkins.py
View file @
3b4d4028
...
@@ -75,7 +75,7 @@ class TestBase_reindexAndSenseAlarm(SlapOSTestCaseMixinWithAbort):
...
@@ -75,7 +75,7 @@ class TestBase_reindexAndSenseAlarm(SlapOSTestCaseMixinWithAbort):
# check that alarm was called after the object was reindexed
# check that alarm was called after the object was reindexed
self
.
assertTrue
(
next_indexation_timestamp
<
edit_timestamp
)
self
.
assertTrue
(
next_indexation_timestamp
<
edit_timestamp
)
self
.
assertEqual
s
(
self
.
assertEqual
(
len
(
alarm
.
workflow_history
[
'edit_workflow'
]),
len
(
alarm
.
workflow_history
[
'edit_workflow'
]),
workflow_history_count
+
1
workflow_history_count
+
1
)
)
...
@@ -101,11 +101,11 @@ class TestBase_reindexAndSenseAlarm(SlapOSTestCaseMixinWithAbort):
...
@@ -101,11 +101,11 @@ class TestBase_reindexAndSenseAlarm(SlapOSTestCaseMixinWithAbort):
next_indexation_timestamp
=
self
.
getIndexationDate
(
document
)
next_indexation_timestamp
=
self
.
getIndexationDate
(
document
)
edit_timestamp
=
alarm
.
getModificationDate
()
edit_timestamp
=
alarm
.
getModificationDate
()
# check that the document was not reindexed
# check that the document was not reindexed
self
.
assertEqual
s
(
previous_indexation_timestamp
,
next_indexation_timestamp
)
self
.
assertEqual
(
previous_indexation_timestamp
,
next_indexation_timestamp
)
# check that alarm was called after the object was reindexed
# check that alarm was called after the object was reindexed
self
.
assertTrue
(
next_indexation_timestamp
<
edit_timestamp
)
self
.
assertTrue
(
next_indexation_timestamp
<
edit_timestamp
)
self
.
assertEqual
s
(
self
.
assertEqual
(
len
(
alarm
.
workflow_history
[
'edit_workflow'
]),
len
(
alarm
.
workflow_history
[
'edit_workflow'
]),
workflow_history_count
+
1
workflow_history_count
+
1
)
)
...
@@ -129,9 +129,9 @@ class TestBase_reindexAndSenseAlarm(SlapOSTestCaseMixinWithAbort):
...
@@ -129,9 +129,9 @@ class TestBase_reindexAndSenseAlarm(SlapOSTestCaseMixinWithAbort):
next_indexation_timestamp
=
self
.
getIndexationDate
(
document
)
next_indexation_timestamp
=
self
.
getIndexationDate
(
document
)
# check that the document was not reindex
# check that the document was not reindex
self
.
assertEqual
s
(
previous_indexation_timestamp
,
next_indexation_timestamp
)
self
.
assertEqual
(
previous_indexation_timestamp
,
next_indexation_timestamp
)
# check that the alarm was not triggered
# check that the alarm was not triggered
self
.
assertEqual
s
(
self
.
assertEqual
(
len
(
alarm
.
workflow_history
[
'edit_workflow'
]),
len
(
alarm
.
workflow_history
[
'edit_workflow'
]),
workflow_history_count
workflow_history_count
)
)
...
@@ -157,7 +157,7 @@ class TestBase_reindexAndSenseAlarm(SlapOSTestCaseMixinWithAbort):
...
@@ -157,7 +157,7 @@ class TestBase_reindexAndSenseAlarm(SlapOSTestCaseMixinWithAbort):
# check that alarm was called ONCE after the object was reindexed
# check that alarm was called ONCE after the object was reindexed
self
.
assertTrue
(
next_indexation_timestamp
<
edit_timestamp
)
self
.
assertTrue
(
next_indexation_timestamp
<
edit_timestamp
)
self
.
assertEqual
s
(
self
.
assertEqual
(
len
(
alarm
.
workflow_history
[
'edit_workflow'
]),
len
(
alarm
.
workflow_history
[
'edit_workflow'
]),
workflow_history_count
+
1
workflow_history_count
+
1
)
)
...
@@ -182,7 +182,7 @@ class TestBase_reindexAndSenseAlarm(SlapOSTestCaseMixinWithAbort):
...
@@ -182,7 +182,7 @@ class TestBase_reindexAndSenseAlarm(SlapOSTestCaseMixinWithAbort):
self
.
tic
()
self
.
tic
()
# check that alarm was called ONCE
# check that alarm was called ONCE
self
.
assertEqual
s
(
self
.
assertEqual
(
len
(
alarm
.
workflow_history
[
'edit_workflow'
]),
len
(
alarm
.
workflow_history
[
'edit_workflow'
]),
workflow_history_count
+
1
workflow_history_count
+
1
)
)
...
@@ -213,7 +213,7 @@ class TestBase_reindexAndSenseAlarm(SlapOSTestCaseMixinWithAbort):
...
@@ -213,7 +213,7 @@ class TestBase_reindexAndSenseAlarm(SlapOSTestCaseMixinWithAbort):
# check that alarm was called ONCE after the object was reindexed
# check that alarm was called ONCE after the object was reindexed
self
.
assertTrue
(
next_indexation_timestamp
<
edit_timestamp
)
self
.
assertTrue
(
next_indexation_timestamp
<
edit_timestamp
)
self
.
assertEqual
s
(
self
.
assertEqual
(
len
(
alarm
.
workflow_history
[
'edit_workflow'
]),
len
(
alarm
.
workflow_history
[
'edit_workflow'
]),
workflow_history_count
+
1
workflow_history_count
+
1
)
)
...
@@ -241,7 +241,7 @@ class TestBase_reindexAndSenseAlarm(SlapOSTestCaseMixinWithAbort):
...
@@ -241,7 +241,7 @@ class TestBase_reindexAndSenseAlarm(SlapOSTestCaseMixinWithAbort):
with
TemporaryAlarmScript
(
alarm
,
'Alarm_allocateInstance'
):
with
TemporaryAlarmScript
(
alarm
,
'Alarm_allocateInstance'
):
self
.
tic
()
self
.
tic
()
self
.
assertEqual
s
(
self
.
assertEqual
(
len
(
alarm
.
workflow_history
[
'edit_workflow'
]),
len
(
alarm
.
workflow_history
[
'edit_workflow'
]),
workflow_history_count
+
3
workflow_history_count
+
3
)
)
...
@@ -277,7 +277,7 @@ class TestBase_reindexAndSenseAlarm(SlapOSTestCaseMixinWithAbort):
...
@@ -277,7 +277,7 @@ class TestBase_reindexAndSenseAlarm(SlapOSTestCaseMixinWithAbort):
self
.
assertTrue
(
next_indexation_timestamp1
<
edit_timestamp
)
self
.
assertTrue
(
next_indexation_timestamp1
<
edit_timestamp
)
self
.
assertTrue
(
next_indexation_timestamp2
<
edit_timestamp
)
self
.
assertTrue
(
next_indexation_timestamp2
<
edit_timestamp
)
self
.
assertEqual
s
(
self
.
assertEqual
(
len
(
alarm
.
workflow_history
[
'edit_workflow'
]),
len
(
alarm
.
workflow_history
[
'edit_workflow'
]),
workflow_history_count
+
1
workflow_history_count
+
1
)
)
...
@@ -314,7 +314,7 @@ class TestBase_reindexAndSenseAlarm(SlapOSTestCaseMixinWithAbort):
...
@@ -314,7 +314,7 @@ class TestBase_reindexAndSenseAlarm(SlapOSTestCaseMixinWithAbort):
self
.
assertTrue
(
next_indexation_timestamp1
<
edit_timestamp
)
self
.
assertTrue
(
next_indexation_timestamp1
<
edit_timestamp
)
self
.
assertTrue
(
next_indexation_timestamp2
<
edit_timestamp
)
self
.
assertTrue
(
next_indexation_timestamp2
<
edit_timestamp
)
self
.
assertEqual
s
(
self
.
assertEqual
(
len
(
alarm
.
workflow_history
[
'edit_workflow'
]),
len
(
alarm
.
workflow_history
[
'edit_workflow'
]),
workflow_history_count
+
1
workflow_history_count
+
1
)
)
...
@@ -349,7 +349,7 @@ class TestBase_reindexAndSenseAlarm(SlapOSTestCaseMixinWithAbort):
...
@@ -349,7 +349,7 @@ class TestBase_reindexAndSenseAlarm(SlapOSTestCaseMixinWithAbort):
self
.
assertTrue
(
next_indexation_timestamp
<
edit_timestamp1
)
self
.
assertTrue
(
next_indexation_timestamp
<
edit_timestamp1
)
self
.
assertTrue
(
next_indexation_timestamp
<
edit_timestamp2
)
self
.
assertTrue
(
next_indexation_timestamp
<
edit_timestamp2
)
self
.
assertEqual
s
(
self
.
assertEqual
(
len
(
alarm1
.
workflow_history
[
'edit_workflow'
]),
len
(
alarm1
.
workflow_history
[
'edit_workflow'
]),
workflow_history_count1
+
1
workflow_history_count1
+
1
)
)
...
@@ -357,7 +357,7 @@ class TestBase_reindexAndSenseAlarm(SlapOSTestCaseMixinWithAbort):
...
@@ -357,7 +357,7 @@ class TestBase_reindexAndSenseAlarm(SlapOSTestCaseMixinWithAbort):
'Visited by Alarm_allocateInstance'
,
'Visited by Alarm_allocateInstance'
,
alarm1
.
workflow_history
[
'edit_workflow'
][
-
1
][
'comment'
]
alarm1
.
workflow_history
[
'edit_workflow'
][
-
1
][
'comment'
]
)
)
self
.
assertEqual
s
(
self
.
assertEqual
(
len
(
alarm2
.
workflow_history
[
'edit_workflow'
]),
len
(
alarm2
.
workflow_history
[
'edit_workflow'
]),
workflow_history_count2
+
1
workflow_history_count2
+
1
)
)
...
...
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5CRMScenario.py
View file @
3b4d4028
...
@@ -101,7 +101,7 @@ class TestSlapOSCRMScenario(TestSlapOSVirtualMasterScenarioMixin):
...
@@ -101,7 +101,7 @@ class TestSlapOSCRMScenario(TestSlapOSVirtualMasterScenarioMixin):
portal_type
=
'Regularisation Request'
,
portal_type
=
'Regularisation Request'
,
destination__uid
=
owner_person
.
getUid
()
destination__uid
=
owner_person
.
getUid
()
)
)
self
.
assertEqual
s
(
regularisation_request
.
getSimulationState
(),
'suspended'
)
self
.
assertEqual
(
regularisation_request
.
getSimulationState
(),
'suspended'
)
##################################################
##################################################
# Trigger regularisation request escalation
# Trigger regularisation request escalation
...
@@ -124,21 +124,21 @@ class TestSlapOSCRMScenario(TestSlapOSVirtualMasterScenarioMixin):
...
@@ -124,21 +124,21 @@ class TestSlapOSCRMScenario(TestSlapOSVirtualMasterScenarioMixin):
# Items must be deleted
# Items must be deleted
# Open Order must be archived
# Open Order must be archived
# Invoice must be paid with Deposit
# Invoice must be paid with Deposit
self
.
assertEqual
s
(
project
.
getValidationState
(),
'invalidated'
)
self
.
assertEqual
(
project
.
getValidationState
(),
'invalidated'
)
self
.
assertEqual
s
(
instance_tree
.
getValidationState
(),
'archived'
)
self
.
assertEqual
(
instance_tree
.
getValidationState
(),
'archived'
)
self
.
assertEqual
s
(
instance_tree
.
getSlapState
(),
'destroy_requested'
)
self
.
assertEqual
(
instance_tree
.
getSlapState
(),
'destroy_requested'
)
self
.
assertEqual
s
(
compute_node
.
getValidationState
(),
'invalidated'
)
self
.
assertEqual
(
compute_node
.
getValidationState
(),
'invalidated'
)
open_order_list
=
self
.
portal
.
portal_catalog
(
open_order_list
=
self
.
portal
.
portal_catalog
(
portal_type
=
'Open Sale Order'
,
portal_type
=
'Open Sale Order'
,
destination_section__uid
=
owner_person
.
getUid
()
destination_section__uid
=
owner_person
.
getUid
()
)
)
hosting_subscription_list
=
[]
hosting_subscription_list
=
[]
self
.
assertEqual
s
(
len
(
open_order_list
),
3
)
self
.
assertEqual
(
len
(
open_order_list
),
3
)
for
open_order
in
open_order_list
:
for
open_order
in
open_order_list
:
self
.
assertEqual
s
(
open_order
.
getValidationState
(),
'archived'
)
self
.
assertEqual
(
open_order
.
getValidationState
(),
'archived'
)
self
.
assertNotEqual
s
(
open_order
.
getStopDate
(),
open_order
.
getStartDate
())
self
.
assertNotEqual
(
open_order
.
getStopDate
(),
open_order
.
getStartDate
())
self
.
assertNotEqual
s
(
open_order
.
getStopDate
(),
None
)
self
.
assertNotEqual
(
open_order
.
getStopDate
(),
None
)
self
.
assertEqual
s
(
open_order
.
getStopDate
(),
DateTime
(
'2020/07/17'
))
self
.
assertEqual
(
open_order
.
getStopDate
(),
DateTime
(
'2020/07/17'
))
for
line
in
open_order
.
contentValues
():
for
line
in
open_order
.
contentValues
():
for
cell
in
line
.
contentValues
():
for
cell
in
line
.
contentValues
():
...
@@ -149,12 +149,12 @@ class TestSlapOSCRMScenario(TestSlapOSVirtualMasterScenarioMixin):
...
@@ -149,12 +149,12 @@ class TestSlapOSCRMScenario(TestSlapOSVirtualMasterScenarioMixin):
if
tmp
is
not
None
:
if
tmp
is
not
None
:
hosting_subscription_list
.
append
(
tmp
)
hosting_subscription_list
.
append
(
tmp
)
self
.
assertEqual
s
(
len
(
hosting_subscription_list
),
3
)
self
.
assertEqual
(
len
(
hosting_subscription_list
),
3
)
for
hosting_subscription
in
hosting_subscription_list
:
for
hosting_subscription
in
hosting_subscription_list
:
self
.
assertEqual
s
(
hosting_subscription
.
getValidationState
(),
'archived'
)
self
.
assertEqual
(
hosting_subscription
.
getValidationState
(),
'archived'
)
self
.
assertEqual
s
(
regularisation_request
.
getSimulationState
(),
'suspended'
)
self
.
assertEqual
(
regularisation_request
.
getSimulationState
(),
'suspended'
)
self
.
assertEqual
s
(
regularisation_request
.
getResourceId
(),
self
.
assertEqual
(
regularisation_request
.
getResourceId
(),
'slapos_crm_delete_acknowledgement'
)
'slapos_crm_delete_acknowledgement'
)
# No planned invoice is expected
# No planned invoice is expected
...
@@ -162,15 +162,15 @@ class TestSlapOSCRMScenario(TestSlapOSVirtualMasterScenarioMixin):
...
@@ -162,15 +162,15 @@ class TestSlapOSCRMScenario(TestSlapOSVirtualMasterScenarioMixin):
outstanding_amount_list
=
owner_person
.
Entity_getOutstandingAmountList
(
outstanding_amount_list
=
owner_person
.
Entity_getOutstandingAmountList
(
ledger_uid
=
ledger_uid
ledger_uid
=
ledger_uid
)
)
self
.
assertEqual
s
(
len
(
outstanding_amount_list
),
1
)
self
.
assertEqual
(
len
(
outstanding_amount_list
),
1
)
self
.
assertEqual
s
(
outstanding_amount_list
[
0
].
total_price
,
132
)
self
.
assertEqual
(
outstanding_amount_list
[
0
].
total_price
,
132
)
planned_outstanding_amount_list
=
owner_person
.
Entity_getOutstandingAmountList
(
planned_outstanding_amount_list
=
owner_person
.
Entity_getOutstandingAmountList
(
ledger_uid
=
ledger_uid
,
ledger_uid
=
ledger_uid
,
include_planned
=
True
include_planned
=
True
)
)
self
.
assertEqual
s
(
len
(
planned_outstanding_amount_list
),
1
)
self
.
assertEqual
(
len
(
planned_outstanding_amount_list
),
1
)
self
.
assertEqual
s
(
outstanding_amount_list
[
0
].
total_price
,
self
.
assertEqual
(
outstanding_amount_list
[
0
].
total_price
,
planned_outstanding_amount_list
[
0
].
total_price
)
planned_outstanding_amount_list
[
0
].
total_price
)
...
...
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