Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
106
Merge Requests
106
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos
Commits
be462165
Commit
be462165
authored
Aug 01, 2017
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_cloud: use person.getUserId() instead person.getReference()
Follow up implementation of ERP5LoginUserManager.
parent
3ba9c9cf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
31 deletions
+58
-31
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudWorkflow.py
...em/portal_components/test.erp5.testSlapOSCloudWorkflow.py
+27
-25
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudWorkflow.xml
...m/portal_components/test.erp5.testSlapOSCloudWorkflow.xml
+31
-6
No files found.
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudWorkflow.py
View file @
be462165
...
...
@@ -163,7 +163,7 @@ class TestSlapOSCoreComputerSlapInterfaceWorkflow(testSlapOSMixin):
def
test_approveComputerRegistration
(
self
):
self
.
_makePerson
()
self
.
login
(
self
.
person_user
.
get
Reference
())
self
.
login
(
self
.
person_user
.
get
UserId
())
new_id
=
self
.
generateNewId
()
computer
=
self
.
portal
.
computer_module
.
newContent
(
portal_type
=
'Computer'
,
title
=
"Computer %s for %s"
%
(
new_id
,
self
.
person_user
.
getReference
()),
...
...
@@ -233,7 +233,7 @@ class TestSlapOSCoreComputerSlapInterfaceWorkflow(testSlapOSMixin):
self
.
_makePerson
()
self
.
computer
.
edit
(
source_administration
=
self
.
person_user
.
getRelativeUrl
())
self
.
tic
()
self
.
login
(
self
.
person_user
.
get
Reference
())
self
.
login
(
self
.
person_user
.
get
UserId
())
self
.
assertRaises
(
TypeError
,
self
.
computer
.
requestSoftwareRelease
,
state
=
'available'
)
transaction
.
abort
()
...
...
@@ -242,7 +242,7 @@ class TestSlapOSCoreComputerSlapInterfaceWorkflow(testSlapOSMixin):
self
.
_makePerson
()
self
.
computer
.
edit
(
source_administration
=
self
.
person_user
.
getRelativeUrl
())
self
.
tic
()
self
.
login
(
self
.
person_user
.
get
Reference
())
self
.
login
(
self
.
person_user
.
get
UserId
())
url
=
self
.
generateNewSoftwareReleaseUrl
()
self
.
assertRaises
(
TypeError
,
self
.
computer
.
requestSoftwareRelease
,
software_release_url
=
url
)
...
...
@@ -252,7 +252,7 @@ class TestSlapOSCoreComputerSlapInterfaceWorkflow(testSlapOSMixin):
self
.
_makePerson
()
self
.
computer
.
edit
(
source_administration
=
self
.
person_user
.
getRelativeUrl
())
self
.
tic
()
self
.
login
(
self
.
person_user
.
get
Reference
())
self
.
login
(
self
.
person_user
.
get
UserId
())
url
=
self
.
generateNewSoftwareReleaseUrl
()
self
.
computer
.
requestSoftwareRelease
(
software_release_url
=
url
,
state
=
'available'
)
...
...
@@ -268,7 +268,7 @@ class TestSlapOSCoreComputerSlapInterfaceWorkflow(testSlapOSMixin):
self
.
_makePerson
()
self
.
computer
.
edit
(
source_administration
=
self
.
person_user
.
getRelativeUrl
())
self
.
tic
()
self
.
login
(
self
.
person_user
.
get
Reference
())
self
.
login
(
self
.
person_user
.
get
UserId
())
url
=
self
.
generateNewSoftwareReleaseUrl
()
self
.
computer
.
requestSoftwareRelease
(
software_release_url
=
url
,
state
=
'destroyed'
)
...
...
@@ -282,7 +282,7 @@ class TestSlapOSCoreComputerSlapInterfaceWorkflow(testSlapOSMixin):
self
.
_makePerson
()
self
.
computer
.
edit
(
source_administration
=
self
.
person_user
.
getRelativeUrl
())
self
.
tic
()
self
.
login
(
self
.
person_user
.
get
Reference
())
self
.
login
(
self
.
person_user
.
get
UserId
())
url
=
self
.
generateNewSoftwareReleaseUrl
()
self
.
computer
.
requestSoftwareRelease
(
software_release_url
=
url
,
state
=
'available'
)
...
...
@@ -310,7 +310,7 @@ class TestSlapOSCoreComputerSlapInterfaceWorkflow(testSlapOSMixin):
self
.
_makePerson
()
self
.
computer
.
edit
(
source_administration
=
self
.
person_user
.
getRelativeUrl
())
self
.
tic
()
self
.
login
(
self
.
person_user
.
get
Reference
())
self
.
login
(
self
.
person_user
.
get
UserId
())
url
=
self
.
generateNewSoftwareReleaseUrl
()
self
.
computer
.
requestSoftwareRelease
(
software_release_url
=
url
,
state
=
'available'
)
...
...
@@ -325,7 +325,7 @@ class TestSlapOSCoreComputerSlapInterfaceWorkflow(testSlapOSMixin):
self
.
_makePerson
()
self
.
computer
.
edit
(
source_administration
=
self
.
person_user
.
getRelativeUrl
())
self
.
tic
()
self
.
login
(
self
.
person_user
.
get
Reference
())
self
.
login
(
self
.
person_user
.
get
UserId
())
url
=
self
.
generateNewSoftwareReleaseUrl
()
self
.
computer
.
requestSoftwareRelease
(
software_release_url
=
url
,
state
=
'available'
)
...
...
@@ -416,7 +416,7 @@ class TestSlapOSCorePersonComputerSupply(testSlapOSMixin):
self
.
tic
()
# Login as new user
self
.
login
(
person_user
.
get
Reference
())
self
.
login
(
person_user
.
get
UserId
())
new_person
=
self
.
getPortalObject
().
ERP5Site_getAuthenticatedMemberPersonValue
()
self
.
assertEquals
(
person_user
.
getRelativeUrl
(),
new_person
.
getRelativeUrl
())
...
...
@@ -988,7 +988,7 @@ class TestSlapOSCoreInstanceSlapInterfaceWorkflow(testSlapOSMixin):
sla_xml
=
sla_xml
,
)
transaction
.
abort
()
# no sla_xml
self
.
assertRaises
(
TypeError
,
self
.
instance
.
requestStop
,
software_release
=
software_release
,
...
...
@@ -1056,7 +1056,7 @@ class TestSlapOSCoreInstanceSlapInterfaceWorkflow(testSlapOSMixin):
sla_xml
=
sla_xml
,
)
transaction
.
abort
()
# no sla_xml
self
.
assertRaises
(
TypeError
,
self
.
instance
.
requestStart
,
software_release
=
software_release
,
...
...
@@ -1958,7 +1958,7 @@ class TestSlapOSCorePersonRequest(testSlapOSMixin):
self
.
tic
()
# Login as new user
self
.
login
(
person_user
.
get
Reference
())
self
.
login
(
person_user
.
get
UserId
())
new_person
=
self
.
getPortalObject
().
ERP5Site_getAuthenticatedMemberPersonValue
()
self
.
assertEquals
(
person_user
.
getRelativeUrl
(),
new_person
.
getRelativeUrl
())
...
...
@@ -2145,7 +2145,7 @@ class TestSlapOSCorePersonRequest(testSlapOSMixin):
state
=
state
,
)
hosting_subscription
=
person
.
REQUEST
.
get
(
'request_hosting_subscription'
)
self
.
assertEquals
(
"Hosting Subscription"
,
self
.
assertEquals
(
"Hosting Subscription"
,
hosting_subscription
.
getPortalType
())
def
test_Person_requestSoftwareInstance_createHostingSubscription
(
self
):
...
...
@@ -2163,7 +2163,7 @@ class TestSlapOSCorePersonRequest(testSlapOSMixin):
state
=
"started"
previous_id
=
self
.
getPortalObject
().
portal_ids
\
.
generateNewId
(
id_group
=
'slap_hosting_subscription_reference'
,
.
generateNewId
(
id_group
=
'slap_hosting_subscription_reference'
,
id_generator
=
'uid'
)
person
.
requestSoftwareInstance
(
...
...
@@ -2520,7 +2520,7 @@ class TestSlapOSCorePersonRequestComputer(testSlapOSMixin):
self
.
tic
()
# Login as new user
self
.
login
(
person_user
.
get
Reference
())
self
.
login
(
person_user
.
get
UserId
())
new_person
=
self
.
getPortalObject
().
ERP5Site_getAuthenticatedMemberPersonValue
()
self
.
assertEquals
(
person_user
.
getRelativeUrl
(),
new_person
.
getRelativeUrl
())
...
...
@@ -2726,7 +2726,7 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(testSlapOSMixin):
def
test_Computer_setSubjectList
(
self
):
self
.
_makePerson
()
self
.
login
(
self
.
person_user
.
get
Reference
())
self
.
login
(
self
.
person_user
.
get
UserId
())
new_id
=
self
.
generateNewId
()
computer
=
self
.
portal
.
computer_module
.
newContent
(
...
...
@@ -2743,7 +2743,7 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(testSlapOSMixin):
def
check_Instance_validate
(
self
,
portal_type
):
self
.
_makePerson
()
self
.
login
(
self
.
person_user
.
get
Reference
())
self
.
login
(
self
.
person_user
.
get
UserId
())
new_id
=
self
.
generateNewId
()
instance
=
self
.
portal
.
software_instance_module
.
newContent
(
...
...
@@ -2759,7 +2759,9 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(testSlapOSMixin):
return
self
.
activeSense_call
()
# Replace activeSense by a dummy method
from
Products.ERP5Type.Document.Alarm
import
Alarm
class
Alarm
:
pass
#from Products.ERP5Type.Document.Alarm import Alarm
Alarm
.
activeSense_call
=
Alarm
.
activeSense
Alarm
.
activeSense
=
verify_activeSense_call
try
:
...
...
@@ -2780,7 +2782,7 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(testSlapOSMixin):
def
test_SlaveInstance_requestDestroy
(
self
):
self
.
_makePerson
()
self
.
login
(
self
.
person_user
.
get
Reference
())
self
.
login
(
self
.
person_user
.
get
UserId
())
new_id
=
self
.
generateNewId
()
instance
=
self
.
portal
.
software_instance_module
.
newContent
(
portal_type
=
'Slave Instance'
,
...
...
@@ -2804,7 +2806,7 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(testSlapOSMixin):
def
check_SoftwareInstallation_changeState
(
self
,
method_id
):
self
.
_makePerson
()
self
.
login
(
self
.
person_user
.
get
Reference
())
self
.
login
(
self
.
person_user
.
get
UserId
())
new_id
=
self
.
generateNewId
()
computer
=
self
.
portal
.
computer_module
.
newContent
(
portal_type
=
'Computer'
,
...
...
@@ -2845,7 +2847,7 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(testSlapOSMixin):
def
check_SoftwareInstance_changeState
(
self
,
method_id
):
self
.
_makePerson
()
self
.
login
(
self
.
person_user
.
get
Reference
())
self
.
login
(
self
.
person_user
.
get
UserId
())
new_id
=
self
.
generateNewId
()
computer
=
self
.
portal
.
computer_module
.
newContent
(
...
...
@@ -2880,7 +2882,7 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(testSlapOSMixin):
def
verify_reindexObject_call
(
self
,
*
args
,
**
kw
):
if
self
.
getRelativeUrl
()
==
partition
.
getRelativeUrl
():
partition
.
portal_workflow
.
doActionFor
(
partition
,
action
=
'edit_action'
,
partition
.
portal_workflow
.
doActionFor
(
partition
,
action
=
'edit_action'
,
comment
=
'reindexObject triggered on %s'
%
method_id
)
else
:
return
self
.
reindexObject_call
(
*
args
,
**
kw
)
...
...
@@ -2909,7 +2911,7 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(testSlapOSMixin):
def
check_change_instance_parameter
(
self
,
portal_type
,
method_id
):
self
.
_makePerson
()
self
.
login
(
self
.
person_user
.
get
Reference
())
self
.
login
(
self
.
person_user
.
get
UserId
())
new_id
=
self
.
generateNewId
()
instance
=
self
.
portal
.
software_instance_module
.
newContent
(
...
...
@@ -2966,7 +2968,7 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(testSlapOSMixin):
portal_type
=
"Software Instance"
self
.
_makePerson
()
self
.
login
(
self
.
person_user
.
get
Reference
())
self
.
login
(
self
.
person_user
.
get
UserId
())
new_id
=
self
.
generateNewId
()
instance3
=
self
.
portal
.
software_instance_module
.
newContent
(
...
...
@@ -3005,7 +3007,7 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(testSlapOSMixin):
def
verify_reindexObject_call
(
self
,
*
args
,
**
kw
):
if
self
.
getRelativeUrl
()
in
(
instance2
.
getRelativeUrl
(),
instance3
.
getRelativeUrl
()):
self
.
portal_workflow
.
doActionFor
(
instance1
,
action
=
'edit_action'
,
self
.
portal_workflow
.
doActionFor
(
instance1
,
action
=
'edit_action'
,
comment
=
'reindexObject triggered'
)
else
:
return
self
.
reindexObject_call
(
*
args
,
**
kw
)
...
...
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudWorkflow.xml
View file @
be462165
...
...
@@ -6,10 +6,22 @@
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_recorded_property_dict
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
testSlapOSCloudWorkflow
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
test.erp5.testSlapOSCloudWorkflow
</string>
</value>
...
...
@@ -27,9 +39,7 @@
<item>
<key>
<string>
text_content_error_message
</string>
</key>
<value>
<tuple>
<string>
F:2762, 4: Unable to import \'Products.ERP5Type.Document.Alarm\' (import-error)
</string>
</tuple>
<tuple/>
</value>
</item>
<item>
...
...
@@ -45,13 +55,28 @@
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
I
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
</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>
...
...
@@ -64,7 +89,7 @@
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
Q
=
</string>
</persistent>
</value>
</item>
</dictionary>
...
...
@@ -73,7 +98,7 @@
</dictionary>
</pickle>
</record>
<record
id=
"
3"
aka=
"AAAAAAAAAAM
="
>
<record
id=
"
4"
aka=
"AAAAAAAAAAQ
="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.patches.WorkflowTool"
/>
</pickle>
...
...
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