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
Guillaume Hervier
slapos.core
Commits
451f9b56
Commit
451f9b56
authored
Nov 12, 2012
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cover alarm configuration.
parent
34925c08
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
351 additions
and
56 deletions
+351
-56
master/bt5/slapos_accounting/PathTemplateItem/open_sale_order_module/template_open_sale_order.xml
...eItem/open_sale_order_module/template_open_sale_order.xml
+149
-0
master/bt5/slapos_accounting/TestTemplateItem/testSlapOSAccountingOpenSaleOrderManagement.py
...mplateItem/testSlapOSAccountingOpenSaleOrderManagement.py
+0
-54
master/bt5/slapos_accounting/TestTemplateItem/testSlapOSAccountingSlapOSRequestUpdateHostingSubscriptionOpenSaleOrderAlarm.py
...apOSRequestUpdateHostingSubscriptionOpenSaleOrderAlarm.py
+199
-0
master/bt5/slapos_accounting/bt/revision
master/bt5/slapos_accounting/bt/revision
+1
-1
master/bt5/slapos_accounting/bt/template_path_list
master/bt5/slapos_accounting/bt/template_path_list
+1
-0
master/bt5/slapos_accounting/bt/template_test_id_list
master/bt5/slapos_accounting/bt/template_test_id_list
+1
-1
No files found.
master/bt5/slapos_accounting/PathTemplateItem/open_sale_order_module/template_open_sale_order.xml
0 → 100644
View file @
451f9b56
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Open Sale Order"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_Access_contents_information_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Auditor
</string>
<string>
Author
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Add_portal_content_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Author
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Delete_objects_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Author
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Modify_portal_content_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Author
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_View_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Auditor
</string>
<string>
Author
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_identity_criterion
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
_range_criterion
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
OSO-TEMPLATE
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
template_open_sale_order
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Open Sale Order
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Template Open Sale Order
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_accounting/TestTemplateItem/testSlapOSAccountingOpenSaleOrderManagement.py
deleted
100644 → 0
View file @
34925c08
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2012 Nexedi SA and Contributors. All Rights Reserved.
#
##############################################################################
from
Products.SlapOS.tests.testSlapOSMixin
import
\
testSlapOSMixin
class
TestOpenSaleOrderManagement
(
testSlapOSMixin
):
def
test_noOSO_newPerson
(
self
):
person
=
self
.
portal
.
person_module
.
newContent
(
portal_type
=
'Person'
,
reference
=
'TESTP-%s'
%
self
.
generateNewId
())
person
.
validate
()
self
.
tic
()
self
.
assertEqual
(
None
,
self
.
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
'Open Sale Order'
,
default_destination_section_uid
=
person
.
getUid
()
))
def
test_noOSO_after_fixConsistency
(
self
):
person
=
self
.
portal
.
person_module
.
newContent
(
portal_type
=
'Person'
,
reference
=
'TESTP-%s'
%
self
.
generateNewId
())
person
.
validate
()
self
.
tic
()
person
.
fixConsistency
()
self
.
tic
()
self
.
assertEqual
(
None
,
self
.
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
'Open Sale Order'
,
default_destination_section_uid
=
person
.
getUid
()
))
def
test_OSO_after_Person_updateOpenSaleOrder
(
self
):
person
=
self
.
portal
.
person_module
.
newContent
(
portal_type
=
'Person'
,
reference
=
'TESTP-%s'
%
self
.
generateNewId
())
person
.
validate
()
self
.
tic
()
person
.
Person_updateOpenSaleOrder
()
self
.
tic
()
open_sale_order_list
=
self
.
portal
.
portal_catalog
(
validation_state
=
'validated'
,
portal_type
=
'Open Sale Order'
,
default_destination_section_uid
=
person
.
getUid
()
)
self
.
assertEqual
(
1
,
len
(
open_sale_order_list
))
open_sale_order
=
open_sale_order_list
[
0
]
self
.
assertEqual
(
'SlapOS Subscription Open Sale Order'
,
open_sale_order
.
getTitle
())
master/bt5/slapos_accounting/TestTemplateItem/testSlapOSAccountingSlapOSRequestUpdateHostingSubscriptionOpenSaleOrderAlarm.py
0 → 100644
View file @
451f9b56
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2012 Nexedi SA and Contributors. All Rights Reserved.
#
##############################################################################
import
transaction
import
functools
from
Products.ERP5Type.tests.utils
import
createZODBPythonScript
from
Products.SlapOS.tests.testSlapOSMixin
import
\
testSlapOSMixin
def
simulateHostingSubscription_requestUpdateOpenSaleOrder
(
func
):
@
functools
.
wraps
(
func
)
def
wrapped
(
self
,
*
args
,
**
kwargs
):
script_name
=
'HostingSubscription_requestUpdateOpenSaleOrder'
if
script_name
in
self
.
portal
.
portal_skins
.
custom
.
objectIds
():
raise
ValueError
(
'Precondition failed: %s exists in custom'
%
script_name
)
createZODBPythonScript
(
self
.
portal
.
portal_skins
.
custom
,
script_name
,
'*args, **kwargs'
,
'# Script body
\
n
'
"""portal_workflow = context.portal_workflow
portal_workflow.doActionFor(context, action='edit_action', comment='Visited by HostingSubscription_requestUpdateOpenSaleOrder') """
)
transaction
.
commit
()
try
:
func
(
self
,
*
args
,
**
kwargs
)
finally
:
if
script_name
in
self
.
portal
.
portal_skins
.
custom
.
objectIds
():
self
.
portal
.
portal_skins
.
custom
.
manage_delObjects
(
script_name
)
transaction
.
commit
()
return
wrapped
class
TestOpenSaleOrderAlarm
(
testSlapOSMixin
):
def
test_noOSO_newPerson
(
self
):
person
=
self
.
portal
.
person_module
.
template_member
\
.
Base_createCloneDocument
(
batch_mode
=
1
)
self
.
tic
()
self
.
assertEqual
(
None
,
self
.
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
'Open Sale Order'
,
default_destination_section_uid
=
person
.
getUid
()
))
def
test_noOSO_after_fixConsistency
(
self
):
person
=
self
.
portal
.
person_module
.
template_member
\
.
Base_createCloneDocument
(
batch_mode
=
1
)
self
.
tic
()
person
.
fixConsistency
()
self
.
tic
()
self
.
assertEqual
(
None
,
self
.
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
'Open Sale Order'
,
default_destination_section_uid
=
person
.
getUid
()
))
def
test_OSO_after_Person_updateOpenSaleOrder
(
self
):
person
=
self
.
portal
.
person_module
.
template_member
\
.
Base_createCloneDocument
(
batch_mode
=
1
)
self
.
tic
()
person
.
Person_updateOpenSaleOrder
()
self
.
tic
()
open_sale_order_list
=
self
.
portal
.
portal_catalog
(
validation_state
=
'validated'
,
portal_type
=
'Open Sale Order'
,
default_destination_section_uid
=
person
.
getUid
()
)
self
.
assertEqual
(
1
,
len
(
open_sale_order_list
))
open_sale_order
=
open_sale_order_list
[
0
]
self
.
assertEqual
(
'SlapOS Subscription Open Sale Order'
,
open_sale_order
.
getTitle
())
@
simulateHostingSubscription_requestUpdateOpenSaleOrder
def
test_alarm_HS_validated
(
self
):
subscription
=
self
.
portal
.
hosting_subscription_module
\
.
template_hosting_subscription
.
Base_createCloneDocument
(
batch_mode
=
1
)
subscription
.
edit
(
reference
=
'TESTHS-%s'
%
self
.
generateNewId
())
self
.
portal
.
portal_workflow
.
_jumpToStateFor
(
subscription
,
'validated'
)
self
.
tic
()
self
.
portal
.
portal_alarms
\
.
slapos_request_update_hosting_subscription_open_sale_order
\
.
activeSense
()
self
.
tic
()
self
.
assertEqual
(
'Visited by HostingSubscription_requestUpdateOpenSaleOrder'
,
subscription
.
workflow_history
[
'edit_workflow'
][
-
1
][
'comment'
])
@
simulateHostingSubscription_requestUpdateOpenSaleOrder
def
test_alarm_HS_validated_OSO_invalidated
(
self
):
subscription
=
self
.
portal
.
hosting_subscription_module
\
.
template_hosting_subscription
.
Base_createCloneDocument
(
batch_mode
=
1
)
subscription
.
edit
(
reference
=
'TESTHS-%s'
%
self
.
generateNewId
())
self
.
portal
.
portal_workflow
.
_jumpToStateFor
(
subscription
,
'validated'
)
open_sale_order
=
self
.
portal
.
open_sale_order_module
\
.
template_open_sale_order
.
Base_createCloneDocument
(
batch_mode
=
1
)
open_sale_order
.
edit
(
reference
=
'TESTOSO-%s'
%
self
.
generateNewId
())
open_sale_order
.
newContent
(
portal_type
=
'Open Sale Order Line'
,
aggregate
=
subscription
.
getRelativeUrl
())
self
.
portal
.
portal_workflow
.
_jumpToStateFor
(
open_sale_order
,
'invalidated'
)
self
.
tic
()
self
.
portal
.
portal_alarms
\
.
slapos_request_update_hosting_subscription_open_sale_order
\
.
activeSense
()
self
.
tic
()
self
.
assertEqual
(
'Visited by HostingSubscription_requestUpdateOpenSaleOrder'
,
subscription
.
workflow_history
[
'edit_workflow'
][
-
1
][
'comment'
])
@
simulateHostingSubscription_requestUpdateOpenSaleOrder
def
test_alarm_HS_archived
(
self
):
subscription
=
self
.
portal
.
hosting_subscription_module
\
.
template_hosting_subscription
.
Base_createCloneDocument
(
batch_mode
=
1
)
subscription
.
edit
(
reference
=
'TESTHS-%s'
%
self
.
generateNewId
())
self
.
portal
.
portal_workflow
.
_jumpToStateFor
(
subscription
,
'archived'
)
self
.
tic
()
self
.
portal
.
portal_alarms
\
.
slapos_request_update_hosting_subscription_open_sale_order
\
.
activeSense
()
self
.
tic
()
self
.
assertEqual
(
'Visited by HostingSubscription_requestUpdateOpenSaleOrder'
,
subscription
.
workflow_history
[
'edit_workflow'
][
-
1
][
'comment'
])
@
simulateHostingSubscription_requestUpdateOpenSaleOrder
def
test_alarm_HS_archived_OSO_validated
(
self
):
subscription
=
self
.
portal
.
hosting_subscription_module
\
.
template_hosting_subscription
.
Base_createCloneDocument
(
batch_mode
=
1
)
subscription
.
edit
(
reference
=
'TESTHS-%s'
%
self
.
generateNewId
())
self
.
portal
.
portal_workflow
.
_jumpToStateFor
(
subscription
,
'archived'
)
open_sale_order
=
self
.
portal
.
open_sale_order_module
\
.
template_open_sale_order
.
Base_createCloneDocument
(
batch_mode
=
1
)
open_sale_order
.
edit
(
reference
=
'TESTOSO-%s'
%
self
.
generateNewId
())
open_sale_order
.
newContent
(
portal_type
=
'Open Sale Order Line'
,
aggregate
=
subscription
.
getRelativeUrl
())
self
.
portal
.
portal_workflow
.
_jumpToStateFor
(
open_sale_order
,
'validated'
)
self
.
tic
()
self
.
portal
.
portal_alarms
\
.
slapos_request_update_hosting_subscription_open_sale_order
\
.
activeSense
()
self
.
tic
()
self
.
assertEqual
(
'Visited by HostingSubscription_requestUpdateOpenSaleOrder'
,
subscription
.
workflow_history
[
'edit_workflow'
][
-
1
][
'comment'
])
@
simulateHostingSubscription_requestUpdateOpenSaleOrder
def
test_alarm_HS_validated_OSO_validated
(
self
):
subscription
=
self
.
portal
.
hosting_subscription_module
\
.
template_hosting_subscription
.
Base_createCloneDocument
(
batch_mode
=
1
)
subscription
.
edit
(
reference
=
'TESTHS-%s'
%
self
.
generateNewId
())
self
.
portal
.
portal_workflow
.
_jumpToStateFor
(
subscription
,
'validated'
)
open_sale_order
=
self
.
portal
.
open_sale_order_module
\
.
template_open_sale_order
.
Base_createCloneDocument
(
batch_mode
=
1
)
open_sale_order
.
edit
(
reference
=
'TESTOSO-%s'
%
self
.
generateNewId
())
open_sale_order
.
newContent
(
portal_type
=
'Open Sale Order Line'
,
aggregate
=
subscription
.
getRelativeUrl
())
self
.
portal
.
portal_workflow
.
_jumpToStateFor
(
open_sale_order
,
'validated'
)
self
.
tic
()
self
.
portal
.
portal_alarms
\
.
slapos_request_update_hosting_subscription_open_sale_order
\
.
activeSense
()
self
.
tic
()
self
.
assertNotEqual
(
'Visited by HostingSubscription_requestUpdateOpenSaleOrder'
,
subscription
.
workflow_history
[
'edit_workflow'
][
-
1
][
'comment'
])
@
simulateHostingSubscription_requestUpdateOpenSaleOrder
def
test_alarm_HS_archived_OSO_invalidated
(
self
):
subscription
=
self
.
portal
.
hosting_subscription_module
\
.
template_hosting_subscription
.
Base_createCloneDocument
(
batch_mode
=
1
)
subscription
.
edit
(
reference
=
'TESTHS-%s'
%
self
.
generateNewId
())
self
.
portal
.
portal_workflow
.
_jumpToStateFor
(
subscription
,
'archived'
)
open_sale_order
=
self
.
portal
.
open_sale_order_module
\
.
template_open_sale_order
.
Base_createCloneDocument
(
batch_mode
=
1
)
open_sale_order
.
edit
(
reference
=
'TESTOSO-%s'
%
self
.
generateNewId
())
open_sale_order
.
newContent
(
portal_type
=
'Open Sale Order Line'
,
aggregate
=
subscription
.
getRelativeUrl
())
self
.
portal
.
portal_workflow
.
_jumpToStateFor
(
open_sale_order
,
'invalidated'
)
self
.
tic
()
self
.
portal
.
portal_alarms
\
.
slapos_request_update_hosting_subscription_open_sale_order
\
.
activeSense
()
self
.
tic
()
self
.
assertNotEqual
(
'Visited by HostingSubscription_requestUpdateOpenSaleOrder'
,
subscription
.
workflow_history
[
'edit_workflow'
][
-
1
][
'comment'
])
master/bt5/slapos_accounting/bt/revision
View file @
451f9b56
4
\ No newline at end of file
5
\ No newline at end of file
master/bt5/slapos_accounting/bt/template_path_list
View file @
451f9b56
open_sale_order_module/template_open_sale_order
organisation_module/vifib_client_A
organisation_module/vifib_client_A/**
organisation_module/vifib_internet
...
...
master/bt5/slapos_accounting/bt/template_test_id_list
View file @
451f9b56
testSlapOSAccountingOpenSaleOrderManagement
\ No newline at end of file
testSlapOSAccountingSlapOSRequestUpdateHostingSubscriptionOpenSaleOrderAlarm
\ No newline at end of file
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