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
Thomas Gambier
slapos.core
Commits
8a18a874
Commit
8a18a874
authored
Jan 16, 2020
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_crm: Update tests to consider tolerance of 30 min to create the a ticket
parent
f1d9c0ca
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
1 deletion
+50
-1
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMSkins.py
...ateItem/portal_components/test.erp5.testSlapOSCRMSkins.py
+50
-1
No files found.
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMSkins.py
View file @
8a18a874
...
...
@@ -1641,7 +1641,7 @@ class TestSlapOSHasError(SlapOSTestCaseMixin):
error_date
=
DateTime
()
memcached_dict
[
instance
.
getReference
()]
=
json
.
dumps
(
{
"created_at"
:
"%s"
%
error_date
,
"text"
:
"#error "
}
{
"created_at"
:
"%s"
%
error_date
,
"text"
:
"#error "
,
"since"
:
"%s"
%
(
error_date
-
2
)
}
)
self
.
assertEqual
(
...
...
@@ -1665,6 +1665,55 @@ class TestSlapOSHasError(SlapOSTestCaseMixin):
transaction
.
commit
()
@
simulate
(
'ERP5Site_isSupportRequestCreationClosed'
,
''
,
'return 0'
)
@
simulate
(
'HostingSubscription_createSupportRequestEvent'
,
'instance, notification_message_reference'
,
'return "Visited by HostingSubscription_createSupportRequestEvent '
\
'%s %s" % (instance.getUid(), notification_message_reference)'
)
def
testHostingSubscription_checkSoftwareInstanceState_tolerance
(
self
):
date
=
DateTime
()
def
getCreationDate
(
*
args
,
**
kwargs
):
return
date
-
2
from
Products.ERP5Type.Base
import
Base
original_get_creation
=
Base
.
getCreationDate
Base
.
getCreationDate
=
getCreationDate
try
:
hosting_subscription
=
self
.
_makeHostingSubscription
()
self
.
assertEqual
(
hosting_subscription
.
getCreationDate
(),
date
-
2
)
self
.
_makeSoftwareInstance
(
hosting_subscription
,
self
.
generateNewSoftwareReleaseUrl
())
instance
=
hosting_subscription
.
getPredecessorValue
()
self
.
assertEqual
(
instance
.
getCreationDate
(),
date
-
2
)
self
.
_makeComputer
()
self
.
_makeComputerPartitionList
()
instance
.
setAggregateValue
(
self
.
computer
.
partition1
)
memcached_dict
=
self
.
portal
.
portal_memcached
.
getMemcachedDict
(
key_prefix
=
'slap_tool'
,
plugin_path
=
'portal_memcached/default_memcached_plugin'
)
error_date
=
DateTime
()
memcached_dict
[
instance
.
getReference
()]
=
json
.
dumps
(
{
"created_at"
:
"%s"
%
error_date
,
"text"
:
"#error "
,
"since"
:
"%s"
%
error_date
}
)
# With tolerance of 30 min this should create SupportRequests immediately
self
.
assertEqual
(
None
,
hosting_subscription
.
HostingSubscription_checkSoftwareInstanceState
())
finally
:
Base
.
getCreationDate
=
original_get_creation
self
.
portal
.
portal_types
.
resetDynamicDocumentsOnceAtTransactionBoundary
()
transaction
.
commit
()
@
simulate
(
'ERP5Site_isSupportRequestCreationClosed'
,
''
,
'return 0'
)
@
simulate
(
'HostingSubscription_createSupportRequestEvent'
,
'instance, notification_message_reference'
,
...
...
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