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
Labels
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Rafael Monnerat
slapos.core
Commits
7a85f1e3
Commit
7a85f1e3
authored
Nov 26, 2024
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Py3: assertEquals is deprecated ise assertEqual instead
parent
c0853f7b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
116 additions
and
116 deletions
+116
-116
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMMonitoringAlarm.py
...rtal_components/test.erp5.testSlapOSCRMMonitoringAlarm.py
+1
-1
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMSkins.py
...ateItem/portal_components/test.erp5.testSlapOSCRMSkins.py
+91
-91
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5SubscriptionChangeRequestScenario.py
...t.erp5.testSlapOSERP5SubscriptionChangeRequestScenario.py
+24
-24
No files found.
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMMonitoringAlarm.py
View file @
7a85f1e3
...
@@ -690,7 +690,7 @@ class TestSlapOSCrmSoftwareInstance_checkInstanceTreeMonitoringState(TestSlapOSC
...
@@ -690,7 +690,7 @@ class TestSlapOSCrmSoftwareInstance_checkInstanceTreeMonitoringState(TestSlapOSC
content_b
=
instance_b
.
workflow_history
[
'edit_workflow'
][
-
1
][
'comment'
]
content_b
=
instance_b
.
workflow_history
[
'edit_workflow'
][
-
1
][
'comment'
]
# The alarm should group by project, so only one out of many should reached.
# The alarm should group by project, so only one out of many should reached.
self
.
assertNotEqual
s
(
content_a
,
content_b
)
self
.
assertNotEqual
(
content_a
,
content_b
)
self
.
assertIn
(
'Visited by %s'
%
script_name
,
[
content_a
,
content_b
])
self
.
assertIn
(
'Visited by %s'
%
script_name
,
[
content_a
,
content_b
])
@
simulate
(
'Project_isSupportRequestCreationClosed'
,
''
,
'return 0'
)
@
simulate
(
'Project_isSupportRequestCreationClosed'
,
''
,
'return 0'
)
...
...
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMSkins.py
View file @
7a85f1e3
...
@@ -364,20 +364,20 @@ class TestTicket_createProjectEvent(TestCRMSkinsMixin):
...
@@ -364,20 +364,20 @@ class TestTicket_createProjectEvent(TestCRMSkinsMixin):
'foo_title'
,
'incoming'
,
'Letter'
,
'foo_title'
,
'incoming'
,
'Letter'
,
'foo resource'
,
'foo text'
,
'foo resource'
,
'foo text'
,
)
)
self
.
assertEqual
s
(
event
.
getPortalType
(),
'Letter'
)
self
.
assertEqual
(
event
.
getPortalType
(),
'Letter'
)
self
.
assertEqual
s
(
event
.
getTitle
(),
'foo_title'
)
self
.
assertEqual
(
event
.
getTitle
(),
'foo_title'
)
self
.
assertEqual
s
(
event
.
getFollowUp
(),
ticket
.
getRelativeUrl
())
self
.
assertEqual
(
event
.
getFollowUp
(),
ticket
.
getRelativeUrl
())
self
.
assertEqual
s
(
event
.
getResource
(),
'foo resource'
)
self
.
assertEqual
(
event
.
getResource
(),
'foo resource'
)
self
.
assertEqual
s
(
event
.
getSource
(),
ticket
.
getDestination
())
self
.
assertEqual
(
event
.
getSource
(),
ticket
.
getDestination
())
self
.
assertEqual
s
(
event
.
getSourceSection
(),
ticket
.
getDestinationSection
())
self
.
assertEqual
(
event
.
getSourceSection
(),
ticket
.
getDestinationSection
())
self
.
assertEqual
s
(
event
.
getSourceProject
(),
ticket
.
getDestinationProject
())
self
.
assertEqual
(
event
.
getSourceProject
(),
ticket
.
getDestinationProject
())
self
.
assertEqual
s
(
event
.
getDestination
(),
ticket
.
getSource
())
self
.
assertEqual
(
event
.
getDestination
(),
ticket
.
getSource
())
self
.
assertEqual
s
(
event
.
getDestinationSection
(),
ticket
.
getSourceSection
())
self
.
assertEqual
(
event
.
getDestinationSection
(),
ticket
.
getSourceSection
())
self
.
assertEqual
s
(
event
.
getDestinationProject
(),
ticket
.
getSourceProject
())
self
.
assertEqual
(
event
.
getDestinationProject
(),
ticket
.
getSourceProject
())
self
.
assertEqual
s
(
event
.
getTextContent
(),
'foo text'
)
self
.
assertEqual
(
event
.
getTextContent
(),
'foo text'
)
self
.
assertEqual
s
(
event
.
getContentType
(),
'text/plain'
)
self
.
assertEqual
(
event
.
getContentType
(),
'text/plain'
)
self
.
assertSameEventAttachmentList
(
event
)
self
.
assertSameEventAttachmentList
(
event
)
self
.
assertEqual
s
(
event
.
getSimulationState
(),
'stopped'
)
self
.
assertEqual
(
event
.
getSimulationState
(),
'stopped'
)
def
test_Ticket_createProjectEvent_incomingEventWithoutAttachmentAndNotExistingNotificationMessage
(
self
):
def
test_Ticket_createProjectEvent_incomingEventWithoutAttachmentAndNotExistingNotificationMessage
(
self
):
ticket
=
self
.
createUsualTicket
()
ticket
=
self
.
createUsualTicket
()
...
@@ -386,20 +386,20 @@ class TestTicket_createProjectEvent(TestCRMSkinsMixin):
...
@@ -386,20 +386,20 @@ class TestTicket_createProjectEvent(TestCRMSkinsMixin):
'foo resource'
,
'foo text'
,
'foo resource'
,
'foo text'
,
notification_message
=
'foo notification message'
notification_message
=
'foo notification message'
)
)
self
.
assertEqual
s
(
event
.
getPortalType
(),
'Letter'
)
self
.
assertEqual
(
event
.
getPortalType
(),
'Letter'
)
self
.
assertEqual
s
(
event
.
getTitle
(),
'foo_title'
)
self
.
assertEqual
(
event
.
getTitle
(),
'foo_title'
)
self
.
assertEqual
s
(
event
.
getFollowUp
(),
ticket
.
getRelativeUrl
())
self
.
assertEqual
(
event
.
getFollowUp
(),
ticket
.
getRelativeUrl
())
self
.
assertEqual
s
(
event
.
getResource
(),
'foo resource'
)
self
.
assertEqual
(
event
.
getResource
(),
'foo resource'
)
self
.
assertEqual
s
(
event
.
getSource
(),
ticket
.
getDestination
())
self
.
assertEqual
(
event
.
getSource
(),
ticket
.
getDestination
())
self
.
assertEqual
s
(
event
.
getSourceSection
(),
ticket
.
getDestinationSection
())
self
.
assertEqual
(
event
.
getSourceSection
(),
ticket
.
getDestinationSection
())
self
.
assertEqual
s
(
event
.
getSourceProject
(),
ticket
.
getDestinationProject
())
self
.
assertEqual
(
event
.
getSourceProject
(),
ticket
.
getDestinationProject
())
self
.
assertEqual
s
(
event
.
getDestination
(),
ticket
.
getSource
())
self
.
assertEqual
(
event
.
getDestination
(),
ticket
.
getSource
())
self
.
assertEqual
s
(
event
.
getDestinationSection
(),
ticket
.
getSourceSection
())
self
.
assertEqual
(
event
.
getDestinationSection
(),
ticket
.
getSourceSection
())
self
.
assertEqual
s
(
event
.
getDestinationProject
(),
ticket
.
getSourceProject
())
self
.
assertEqual
(
event
.
getDestinationProject
(),
ticket
.
getSourceProject
())
self
.
assertEqual
s
(
event
.
getTextContent
(),
'foo text'
)
self
.
assertEqual
(
event
.
getTextContent
(),
'foo text'
)
self
.
assertEqual
s
(
event
.
getContentType
(),
'text/plain'
)
self
.
assertEqual
(
event
.
getContentType
(),
'text/plain'
)
self
.
assertSameEventAttachmentList
(
event
)
self
.
assertSameEventAttachmentList
(
event
)
self
.
assertEqual
s
(
event
.
getSimulationState
(),
'stopped'
)
self
.
assertEqual
(
event
.
getSimulationState
(),
'stopped'
)
def
test_Ticket_createProjectEvent_incomingEventWithoutAttachmentAndNotificationMessage
(
self
):
def
test_Ticket_createProjectEvent_incomingEventWithoutAttachmentAndNotificationMessage
(
self
):
ticket
=
self
.
createUsualTicket
()
ticket
=
self
.
createUsualTicket
()
...
@@ -420,20 +420,20 @@ class TestTicket_createProjectEvent(TestCRMSkinsMixin):
...
@@ -420,20 +420,20 @@ class TestTicket_createProjectEvent(TestCRMSkinsMixin):
notification_message
=
notification_message
.
getReference
(),
notification_message
=
notification_message
.
getReference
(),
language
=
notification_message
.
getLanguage
()
language
=
notification_message
.
getLanguage
()
)
)
self
.
assertEqual
s
(
event
.
getPortalType
(),
'Letter'
)
self
.
assertEqual
(
event
.
getPortalType
(),
'Letter'
)
self
.
assertEqual
s
(
event
.
getTitle
(),
notification_message
.
getTitle
())
self
.
assertEqual
(
event
.
getTitle
(),
notification_message
.
getTitle
())
self
.
assertEqual
s
(
event
.
getFollowUp
(),
ticket
.
getRelativeUrl
())
self
.
assertEqual
(
event
.
getFollowUp
(),
ticket
.
getRelativeUrl
())
self
.
assertEqual
s
(
event
.
getResource
(),
'foo resource'
)
self
.
assertEqual
(
event
.
getResource
(),
'foo resource'
)
self
.
assertEqual
s
(
event
.
getSource
(),
ticket
.
getDestination
())
self
.
assertEqual
(
event
.
getSource
(),
ticket
.
getDestination
())
self
.
assertEqual
s
(
event
.
getSourceSection
(),
ticket
.
getDestinationSection
())
self
.
assertEqual
(
event
.
getSourceSection
(),
ticket
.
getDestinationSection
())
self
.
assertEqual
s
(
event
.
getSourceProject
(),
ticket
.
getDestinationProject
())
self
.
assertEqual
(
event
.
getSourceProject
(),
ticket
.
getDestinationProject
())
self
.
assertEqual
s
(
event
.
getDestination
(),
ticket
.
getSource
())
self
.
assertEqual
(
event
.
getDestination
(),
ticket
.
getSource
())
self
.
assertEqual
s
(
event
.
getDestinationSection
(),
ticket
.
getSourceSection
())
self
.
assertEqual
(
event
.
getDestinationSection
(),
ticket
.
getSourceSection
())
self
.
assertEqual
s
(
event
.
getDestinationProject
(),
ticket
.
getSourceProject
())
self
.
assertEqual
(
event
.
getDestinationProject
(),
ticket
.
getSourceProject
())
self
.
assertEqual
s
(
event
.
getTextContent
(),
notification_message
.
getTextContent
())
self
.
assertEqual
(
event
.
getTextContent
(),
notification_message
.
getTextContent
())
self
.
assertEqual
s
(
event
.
getContentType
(),
notification_message
.
getContentType
())
self
.
assertEqual
(
event
.
getContentType
(),
notification_message
.
getContentType
())
self
.
assertSameEventAttachmentList
(
event
)
self
.
assertSameEventAttachmentList
(
event
)
self
.
assertEqual
s
(
event
.
getSimulationState
(),
'stopped'
)
self
.
assertEqual
(
event
.
getSimulationState
(),
'stopped'
)
def
test_Ticket_createProjectEvent_incomingEventWithSourceAndDestination
(
self
):
def
test_Ticket_createProjectEvent_incomingEventWithSourceAndDestination
(
self
):
ticket
=
self
.
createUsualTicket
()
ticket
=
self
.
createUsualTicket
()
...
@@ -451,20 +451,20 @@ class TestTicket_createProjectEvent(TestCRMSkinsMixin):
...
@@ -451,20 +451,20 @@ class TestTicket_createProjectEvent(TestCRMSkinsMixin):
source
=
source_value
.
getRelativeUrl
(),
source
=
source_value
.
getRelativeUrl
(),
destination
=
destination_value
.
getRelativeUrl
()
destination
=
destination_value
.
getRelativeUrl
()
)
)
self
.
assertEqual
s
(
event
.
getPortalType
(),
'Letter'
)
self
.
assertEqual
(
event
.
getPortalType
(),
'Letter'
)
self
.
assertEqual
s
(
event
.
getTitle
(),
'foo_title'
)
self
.
assertEqual
(
event
.
getTitle
(),
'foo_title'
)
self
.
assertEqual
s
(
event
.
getFollowUp
(),
ticket
.
getRelativeUrl
())
self
.
assertEqual
(
event
.
getFollowUp
(),
ticket
.
getRelativeUrl
())
self
.
assertEqual
s
(
event
.
getResource
(),
'foo resource'
)
self
.
assertEqual
(
event
.
getResource
(),
'foo resource'
)
self
.
assertEqual
s
(
event
.
getSource
(),
source_value
.
getRelativeUrl
())
self
.
assertEqual
(
event
.
getSource
(),
source_value
.
getRelativeUrl
())
self
.
assertEqual
s
(
event
.
getSourceSection
(),
ticket
.
getDestinationSection
())
self
.
assertEqual
(
event
.
getSourceSection
(),
ticket
.
getDestinationSection
())
self
.
assertEqual
s
(
event
.
getSourceProject
(),
ticket
.
getDestinationProject
())
self
.
assertEqual
(
event
.
getSourceProject
(),
ticket
.
getDestinationProject
())
self
.
assertEqual
s
(
event
.
getDestination
(),
destination_value
.
getRelativeUrl
())
self
.
assertEqual
(
event
.
getDestination
(),
destination_value
.
getRelativeUrl
())
self
.
assertEqual
s
(
event
.
getDestinationSection
(),
ticket
.
getSourceSection
())
self
.
assertEqual
(
event
.
getDestinationSection
(),
ticket
.
getSourceSection
())
self
.
assertEqual
s
(
event
.
getDestinationProject
(),
ticket
.
getSourceProject
())
self
.
assertEqual
(
event
.
getDestinationProject
(),
ticket
.
getSourceProject
())
self
.
assertEqual
s
(
event
.
getTextContent
(),
'foo text'
)
self
.
assertEqual
(
event
.
getTextContent
(),
'foo text'
)
self
.
assertEqual
s
(
event
.
getContentType
(),
'text/plain'
)
self
.
assertEqual
(
event
.
getContentType
(),
'text/plain'
)
self
.
assertSameEventAttachmentList
(
event
)
self
.
assertSameEventAttachmentList
(
event
)
self
.
assertEqual
s
(
event
.
getSimulationState
(),
'stopped'
)
self
.
assertEqual
(
event
.
getSimulationState
(),
'stopped'
)
def
test_Ticket_createProjectEvent_incomingEventWithAttachment
(
self
):
def
test_Ticket_createProjectEvent_incomingEventWithAttachment
(
self
):
ticket
=
self
.
createUsualTicket
()
ticket
=
self
.
createUsualTicket
()
...
@@ -473,24 +473,24 @@ class TestTicket_createProjectEvent(TestCRMSkinsMixin):
...
@@ -473,24 +473,24 @@ class TestTicket_createProjectEvent(TestCRMSkinsMixin):
'foo resource'
,
'foo text'
,
'foo resource'
,
'foo text'
,
attachment
=
self
.
makeImageFileUpload
()
attachment
=
self
.
makeImageFileUpload
()
)
)
self
.
assertEqual
s
(
event
.
getPortalType
(),
'Web Message'
)
self
.
assertEqual
(
event
.
getPortalType
(),
'Web Message'
)
self
.
assertEqual
s
(
event
.
getTitle
(),
'foo_title'
)
self
.
assertEqual
(
event
.
getTitle
(),
'foo_title'
)
self
.
assertEqual
s
(
event
.
getFollowUp
(),
ticket
.
getRelativeUrl
())
self
.
assertEqual
(
event
.
getFollowUp
(),
ticket
.
getRelativeUrl
())
self
.
assertEqual
s
(
event
.
getResource
(),
'foo resource'
)
self
.
assertEqual
(
event
.
getResource
(),
'foo resource'
)
self
.
assertEqual
s
(
event
.
getSource
(),
ticket
.
getDestination
())
self
.
assertEqual
(
event
.
getSource
(),
ticket
.
getDestination
())
self
.
assertEqual
s
(
event
.
getSourceSection
(),
ticket
.
getDestinationSection
())
self
.
assertEqual
(
event
.
getSourceSection
(),
ticket
.
getDestinationSection
())
self
.
assertEqual
s
(
event
.
getSourceProject
(),
ticket
.
getDestinationProject
())
self
.
assertEqual
(
event
.
getSourceProject
(),
ticket
.
getDestinationProject
())
self
.
assertEqual
s
(
event
.
getDestination
(),
ticket
.
getSource
())
self
.
assertEqual
(
event
.
getDestination
(),
ticket
.
getSource
())
self
.
assertEqual
s
(
event
.
getDestinationSection
(),
ticket
.
getSourceSection
())
self
.
assertEqual
(
event
.
getDestinationSection
(),
ticket
.
getSourceSection
())
self
.
assertEqual
s
(
event
.
getDestinationProject
(),
ticket
.
getSourceProject
())
self
.
assertEqual
(
event
.
getDestinationProject
(),
ticket
.
getSourceProject
())
self
.
assertEqual
s
(
event
.
getTextContent
(),
'foo text'
)
self
.
assertEqual
(
event
.
getTextContent
(),
'foo text'
)
self
.
assertEqual
s
(
event
.
getContentType
(),
'text/plain'
)
self
.
assertEqual
(
event
.
getContentType
(),
'text/plain'
)
self
.
assertSameEventAttachmentList
(
event
,
[{
self
.
assertSameEventAttachmentList
(
event
,
[{
"index"
:
2
,
"index"
:
2
,
"content_type"
:
"image/png"
,
"content_type"
:
"image/png"
,
"title"
:
"erp5_logo.png"
"title"
:
"erp5_logo.png"
}])
}])
self
.
assertEqual
s
(
event
.
getSimulationState
(),
'stopped'
)
self
.
assertEqual
(
event
.
getSimulationState
(),
'stopped'
)
def
test_Ticket_createProjectEvent_incomingEventWithAttachmentAndNotificationMessage
(
self
):
def
test_Ticket_createProjectEvent_incomingEventWithAttachmentAndNotificationMessage
(
self
):
ticket
=
self
.
createUsualTicket
()
ticket
=
self
.
createUsualTicket
()
...
@@ -509,20 +509,20 @@ class TestTicket_createProjectEvent(TestCRMSkinsMixin):
...
@@ -509,20 +509,20 @@ class TestTicket_createProjectEvent(TestCRMSkinsMixin):
'foo_title'
,
'outgoing'
,
'Web Message'
,
'foo_title'
,
'outgoing'
,
'Web Message'
,
'foo resource'
,
'foo text'
,
'foo resource'
,
'foo text'
,
)
)
self
.
assertEqual
s
(
event
.
getPortalType
(),
'Web Message'
)
self
.
assertEqual
(
event
.
getPortalType
(),
'Web Message'
)
self
.
assertEqual
s
(
event
.
getTitle
(),
'foo_title'
)
self
.
assertEqual
(
event
.
getTitle
(),
'foo_title'
)
self
.
assertEqual
s
(
event
.
getFollowUp
(),
ticket
.
getRelativeUrl
())
self
.
assertEqual
(
event
.
getFollowUp
(),
ticket
.
getRelativeUrl
())
self
.
assertEqual
s
(
event
.
getResource
(),
'foo resource'
)
self
.
assertEqual
(
event
.
getResource
(),
'foo resource'
)
self
.
assertEqual
s
(
event
.
getDestination
(),
ticket
.
getDestination
())
self
.
assertEqual
(
event
.
getDestination
(),
ticket
.
getDestination
())
self
.
assertEqual
s
(
event
.
getDestinationSection
(),
ticket
.
getDestinationSection
())
self
.
assertEqual
(
event
.
getDestinationSection
(),
ticket
.
getDestinationSection
())
self
.
assertEqual
s
(
event
.
getDestinationProject
(),
ticket
.
getDestinationProject
())
self
.
assertEqual
(
event
.
getDestinationProject
(),
ticket
.
getDestinationProject
())
self
.
assertEqual
s
(
event
.
getSource
(),
ticket
.
getSource
())
self
.
assertEqual
(
event
.
getSource
(),
ticket
.
getSource
())
self
.
assertEqual
s
(
event
.
getSourceSection
(),
ticket
.
getSourceSection
())
self
.
assertEqual
(
event
.
getSourceSection
(),
ticket
.
getSourceSection
())
self
.
assertEqual
s
(
event
.
getSourceProject
(),
ticket
.
getSourceProject
())
self
.
assertEqual
(
event
.
getSourceProject
(),
ticket
.
getSourceProject
())
self
.
assertEqual
s
(
event
.
getTextContent
(),
'foo text'
)
self
.
assertEqual
(
event
.
getTextContent
(),
'foo text'
)
self
.
assertEqual
s
(
event
.
getContentType
(),
'text/plain'
)
self
.
assertEqual
(
event
.
getContentType
(),
'text/plain'
)
self
.
assertSameEventAttachmentList
(
event
)
self
.
assertSameEventAttachmentList
(
event
)
self
.
assertEqual
s
(
event
.
getSimulationState
(),
'delivered'
)
self
.
assertEqual
(
event
.
getSimulationState
(),
'delivered'
)
def
test_Ticket_createProjectEvent_outgoingEventWithSourceAndDestination
(
self
):
def
test_Ticket_createProjectEvent_outgoingEventWithSourceAndDestination
(
self
):
ticket
=
self
.
createUsualTicket
()
ticket
=
self
.
createUsualTicket
()
...
@@ -540,18 +540,18 @@ class TestTicket_createProjectEvent(TestCRMSkinsMixin):
...
@@ -540,18 +540,18 @@ class TestTicket_createProjectEvent(TestCRMSkinsMixin):
source
=
source_value
.
getRelativeUrl
(),
source
=
source_value
.
getRelativeUrl
(),
destination
=
destination_value
.
getRelativeUrl
()
destination
=
destination_value
.
getRelativeUrl
()
)
)
self
.
assertEqual
s
(
event
.
getPortalType
(),
'Web Message'
)
self
.
assertEqual
(
event
.
getPortalType
(),
'Web Message'
)
self
.
assertEqual
s
(
event
.
getTitle
(),
'foo_title'
)
self
.
assertEqual
(
event
.
getTitle
(),
'foo_title'
)
self
.
assertEqual
s
(
event
.
getFollowUp
(),
ticket
.
getRelativeUrl
())
self
.
assertEqual
(
event
.
getFollowUp
(),
ticket
.
getRelativeUrl
())
self
.
assertEqual
s
(
event
.
getResource
(),
'foo resource'
)
self
.
assertEqual
(
event
.
getResource
(),
'foo resource'
)
self
.
assertEqual
s
(
event
.
getDestination
(),
destination_value
.
getRelativeUrl
())
self
.
assertEqual
(
event
.
getDestination
(),
destination_value
.
getRelativeUrl
())
self
.
assertEqual
s
(
event
.
getDestinationSection
(),
ticket
.
getDestinationSection
())
self
.
assertEqual
(
event
.
getDestinationSection
(),
ticket
.
getDestinationSection
())
self
.
assertEqual
s
(
event
.
getDestinationProject
(),
ticket
.
getDestinationProject
())
self
.
assertEqual
(
event
.
getDestinationProject
(),
ticket
.
getDestinationProject
())
self
.
assertEqual
s
(
event
.
getSource
(),
source_value
.
getRelativeUrl
())
self
.
assertEqual
(
event
.
getSource
(),
source_value
.
getRelativeUrl
())
self
.
assertEqual
s
(
event
.
getSourceSection
(),
ticket
.
getSourceSection
())
self
.
assertEqual
(
event
.
getSourceSection
(),
ticket
.
getSourceSection
())
self
.
assertEqual
s
(
event
.
getSourceProject
(),
ticket
.
getSourceProject
())
self
.
assertEqual
(
event
.
getSourceProject
(),
ticket
.
getSourceProject
())
self
.
assertEqual
s
(
event
.
getTextContent
(),
'foo text'
)
self
.
assertEqual
(
event
.
getTextContent
(),
'foo text'
)
self
.
assertEqual
s
(
event
.
getContentType
(),
'text/plain'
)
self
.
assertEqual
(
event
.
getContentType
(),
'text/plain'
)
self
.
assertSameEventAttachmentList
(
event
)
self
.
assertSameEventAttachmentList
(
event
)
self
.
assertEqual
s
(
event
.
getSimulationState
(),
'delivered'
)
self
.
assertEqual
(
event
.
getSimulationState
(),
'delivered'
)
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5SubscriptionChangeRequestScenario.py
View file @
7a85f1e3
...
@@ -123,7 +123,7 @@ class TestSlapOSSubscriptionChangeRequestScenario(TestSlapOSSubscriptionChangeRe
...
@@ -123,7 +123,7 @@ class TestSlapOSSubscriptionChangeRequestScenario(TestSlapOSSubscriptionChangeRe
self
.
tic
()
self
.
tic
()
self
.
logout
()
self
.
logout
()
self
.
login
()
self
.
login
()
self
.
assertEqual
s
(
instance_tree
.
getDestinationSection
(),
self
.
assertEqual
(
instance_tree
.
getDestinationSection
(),
public_person2
.
getRelativeUrl
())
public_person2
.
getRelativeUrl
())
...
@@ -136,8 +136,8 @@ class TestSlapOSSubscriptionChangeRequestScenario(TestSlapOSSubscriptionChangeRe
...
@@ -136,8 +136,8 @@ class TestSlapOSSubscriptionChangeRequestScenario(TestSlapOSSubscriptionChangeRe
'resource_uid'
:
subscription_change_request
.
getResourceUid
(),
'resource_uid'
:
subscription_change_request
.
getResourceUid
(),
}
}
inventory_list
=
self
.
portal
.
portal_simulation
.
getCurrentInventoryList
(
**
inventory_list_kw
)
inventory_list
=
self
.
portal
.
portal_simulation
.
getCurrentInventoryList
(
**
inventory_list_kw
)
self
.
assertEqual
s
(
1
,
len
(
inventory_list
))
self
.
assertEqual
(
1
,
len
(
inventory_list
))
self
.
assertEqual
s
(
0
,
inventory_list
[
0
].
total_quantity
)
self
.
assertEqual
(
0
,
inventory_list
[
0
].
total_quantity
)
# Seller only sold 1 month
# Seller only sold 1 month
inventory_list_kw
=
{
inventory_list_kw
=
{
...
@@ -149,9 +149,9 @@ class TestSlapOSSubscriptionChangeRequestScenario(TestSlapOSSubscriptionChangeRe
...
@@ -149,9 +149,9 @@ class TestSlapOSSubscriptionChangeRequestScenario(TestSlapOSSubscriptionChangeRe
'resource_uid'
:
subscription_change_request
.
getResourceUid
(),
'resource_uid'
:
subscription_change_request
.
getResourceUid
(),
}
}
inventory_list
=
self
.
portal
.
portal_simulation
.
getCurrentInventoryList
(
**
inventory_list_kw
)
inventory_list
=
self
.
portal
.
portal_simulation
.
getCurrentInventoryList
(
**
inventory_list_kw
)
self
.
assertEqual
s
(
1
,
len
(
inventory_list
))
self
.
assertEqual
(
1
,
len
(
inventory_list
))
# 2 - 0.42 (13 days of 31) - 0.1 (3 days of 31) + 1 - 0.83 (24 days of 29)
# 2 - 0.42 (13 days of 31) - 0.1 (3 days of 31) + 1 - 0.83 (24 days of 29)
self
.
assertAlmostEqual
s
(
-
1.65
,
inventory_list
[
0
].
total_quantity
)
self
.
assertAlmostEqual
(
-
1.65
,
inventory_list
[
0
].
total_quantity
)
inventory_list_kw
=
{
inventory_list_kw
=
{
'group_by_section'
:
False
,
'group_by_section'
:
False
,
...
@@ -160,12 +160,12 @@ class TestSlapOSSubscriptionChangeRequestScenario(TestSlapOSSubscriptionChangeRe
...
@@ -160,12 +160,12 @@ class TestSlapOSSubscriptionChangeRequestScenario(TestSlapOSSubscriptionChangeRe
'resource_uid'
:
subscription_change_request
.
getResourceUid
(),
'resource_uid'
:
subscription_change_request
.
getResourceUid
(),
}
}
inventory_list
=
self
.
portal
.
portal_simulation
.
getCurrentInventoryList
(
**
inventory_list_kw
)
inventory_list
=
self
.
portal
.
portal_simulation
.
getCurrentInventoryList
(
**
inventory_list_kw
)
self
.
assertEqual
s
(
3
,
len
(
inventory_list
))
self
.
assertEqual
(
3
,
len
(
inventory_list
))
# tracking_list = instance_tree.Item_getTrackingList()
# tracking_list = instance_tree.Item_getTrackingList()
# self.assertEqual
s
(2, len(tracking_list))
# self.assertEqual(2, len(tracking_list))
# XXX TODO self.assertEqual
s
(None, self.portal.portal_simulation.getInventoryList())
# XXX TODO self.assertEqual(None, self.portal.portal_simulation.getInventoryList())
# Ensure no unexpected object has been created
# Ensure no unexpected object has been created
# 2 credential request
# 2 credential request
...
@@ -246,13 +246,13 @@ class TestSlapOSSubscriptionChangeRequestScenario(TestSlapOSSubscriptionChangeRe
...
@@ -246,13 +246,13 @@ class TestSlapOSSubscriptionChangeRequestScenario(TestSlapOSSubscriptionChangeRe
self
.
tic
()
self
.
tic
()
self
.
logout
()
self
.
logout
()
self
.
login
()
self
.
login
()
self
.
assertEqual
s
(
new_trade_condition
.
getDestination
(),
self
.
assertEqual
(
new_trade_condition
.
getDestination
(),
owner_person
.
getRelativeUrl
())
owner_person
.
getRelativeUrl
())
self
.
assertEqual
s
(
new_trade_condition
.
getDestinationSection
(),
self
.
assertEqual
(
new_trade_condition
.
getDestinationSection
(),
owner_organisation
.
getRelativeUrl
())
owner_organisation
.
getRelativeUrl
())
self
.
assertEqual
s
(
new_trade_condition
.
getPortalType
(),
self
.
assertEqual
(
new_trade_condition
.
getPortalType
(),
'Sale Trade Condition'
)
'Sale Trade Condition'
)
self
.
assertEqual
s
(
subscription_request
.
getSimulationState
(),
self
.
assertEqual
(
subscription_request
.
getSimulationState
(),
'cancelled'
)
'cancelled'
)
new_subscription_request
=
self
.
portal
.
portal_catalog
.
getResultValue
(
new_subscription_request
=
self
.
portal
.
portal_catalog
.
getResultValue
(
...
@@ -260,11 +260,11 @@ class TestSlapOSSubscriptionChangeRequestScenario(TestSlapOSSubscriptionChangeRe
...
@@ -260,11 +260,11 @@ class TestSlapOSSubscriptionChangeRequestScenario(TestSlapOSSubscriptionChangeRe
aggregate__uid
=
project
.
getUid
(),
aggregate__uid
=
project
.
getUid
(),
simulation_state
=
'submitted'
simulation_state
=
'submitted'
)
)
self
.
assertEqual
s
(
new_subscription_request
.
getDestination
(),
self
.
assertEqual
(
new_subscription_request
.
getDestination
(),
owner_person
.
getRelativeUrl
())
owner_person
.
getRelativeUrl
())
self
.
assertEqual
s
(
new_subscription_request
.
getDestinationSection
(),
self
.
assertEqual
(
new_subscription_request
.
getDestinationSection
(),
owner_organisation
.
getRelativeUrl
())
owner_organisation
.
getRelativeUrl
())
self
.
assertEqual
s
(
new_subscription_request
.
getSimulationState
(),
self
.
assertEqual
(
new_subscription_request
.
getSimulationState
(),
'submitted'
)
'submitted'
)
# If the script is called a second time,
# If the script is called a second time,
...
@@ -274,7 +274,7 @@ class TestSlapOSSubscriptionChangeRequestScenario(TestSlapOSSubscriptionChangeRe
...
@@ -274,7 +274,7 @@ class TestSlapOSSubscriptionChangeRequestScenario(TestSlapOSSubscriptionChangeRe
new_subscription_request
.
getReference
(),
new_subscription_request
.
getReference
(),
None
None
)
)
self
.
assertEqual
s
(
new_subscription_request
.
getRelativeUrl
(),
self
.
assertEqual
(
new_subscription_request
.
getRelativeUrl
(),
new_subscription_request_2
.
getRelativeUrl
())
new_subscription_request_2
.
getRelativeUrl
())
# Ensure no unexpected object has been created
# Ensure no unexpected object has been created
...
@@ -367,13 +367,13 @@ class TestSlapOSSubscriptionChangeRequestScenario(TestSlapOSSubscriptionChangeRe
...
@@ -367,13 +367,13 @@ class TestSlapOSSubscriptionChangeRequestScenario(TestSlapOSSubscriptionChangeRe
self
.
tic
()
self
.
tic
()
self
.
logout
()
self
.
logout
()
self
.
login
()
self
.
login
()
self
.
assertEqual
s
(
new_trade_condition
.
getDestination
(),
self
.
assertEqual
(
new_trade_condition
.
getDestination
(),
owner_person
.
getRelativeUrl
())
owner_person
.
getRelativeUrl
())
self
.
assertEqual
s
(
new_trade_condition
.
getDestinationSection
(),
self
.
assertEqual
(
new_trade_condition
.
getDestinationSection
(),
owner_organisation
.
getRelativeUrl
())
owner_organisation
.
getRelativeUrl
())
self
.
assertEqual
s
(
new_trade_condition
.
getPortalType
(),
self
.
assertEqual
(
new_trade_condition
.
getPortalType
(),
'Sale Trade Condition'
)
'Sale Trade Condition'
)
self
.
assertEqual
s
(
subscription_request
.
getSimulationState
(),
self
.
assertEqual
(
subscription_request
.
getSimulationState
(),
'cancelled'
)
'cancelled'
)
new_subscription_request
=
self
.
portal
.
portal_catalog
.
getResultValue
(
new_subscription_request
=
self
.
portal
.
portal_catalog
.
getResultValue
(
...
@@ -381,11 +381,11 @@ class TestSlapOSSubscriptionChangeRequestScenario(TestSlapOSSubscriptionChangeRe
...
@@ -381,11 +381,11 @@ class TestSlapOSSubscriptionChangeRequestScenario(TestSlapOSSubscriptionChangeRe
aggregate__reference
=
compute_node_id
,
aggregate__reference
=
compute_node_id
,
simulation_state
=
'submitted'
simulation_state
=
'submitted'
)
)
self
.
assertEqual
s
(
new_subscription_request
.
getDestination
(),
self
.
assertEqual
(
new_subscription_request
.
getDestination
(),
owner_person
.
getRelativeUrl
())
owner_person
.
getRelativeUrl
())
self
.
assertEqual
s
(
new_subscription_request
.
getDestinationSection
(),
self
.
assertEqual
(
new_subscription_request
.
getDestinationSection
(),
owner_organisation
.
getRelativeUrl
())
owner_organisation
.
getRelativeUrl
())
self
.
assertEqual
s
(
new_subscription_request
.
getSimulationState
(),
self
.
assertEqual
(
new_subscription_request
.
getSimulationState
(),
'submitted'
)
'submitted'
)
# If the script is called a second time,
# If the script is called a second time,
...
@@ -395,7 +395,7 @@ class TestSlapOSSubscriptionChangeRequestScenario(TestSlapOSSubscriptionChangeRe
...
@@ -395,7 +395,7 @@ class TestSlapOSSubscriptionChangeRequestScenario(TestSlapOSSubscriptionChangeRe
new_subscription_request
.
getReference
(),
new_subscription_request
.
getReference
(),
None
None
)
)
self
.
assertEqual
s
(
new_subscription_request
.
getRelativeUrl
(),
self
.
assertEqual
(
new_subscription_request
.
getRelativeUrl
(),
new_subscription_request_2
.
getRelativeUrl
())
new_subscription_request_2
.
getRelativeUrl
())
# Ensure no unexpected object has been created
# Ensure no unexpected object has been created
...
...
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