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
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
Show 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):
...
@@ -163,7 +163,7 @@ class TestSlapOSCoreComputerSlapInterfaceWorkflow(testSlapOSMixin):
def
test_approveComputerRegistration
(
self
):
def
test_approveComputerRegistration
(
self
):
self
.
_makePerson
()
self
.
_makePerson
()
self
.
login
(
self
.
person_user
.
get
Reference
())
self
.
login
(
self
.
person_user
.
get
UserId
())
new_id
=
self
.
generateNewId
()
new_id
=
self
.
generateNewId
()
computer
=
self
.
portal
.
computer_module
.
newContent
(
portal_type
=
'Computer'
,
computer
=
self
.
portal
.
computer_module
.
newContent
(
portal_type
=
'Computer'
,
title
=
"Computer %s for %s"
%
(
new_id
,
self
.
person_user
.
getReference
()),
title
=
"Computer %s for %s"
%
(
new_id
,
self
.
person_user
.
getReference
()),
...
@@ -233,7 +233,7 @@ class TestSlapOSCoreComputerSlapInterfaceWorkflow(testSlapOSMixin):
...
@@ -233,7 +233,7 @@ class TestSlapOSCoreComputerSlapInterfaceWorkflow(testSlapOSMixin):
self
.
_makePerson
()
self
.
_makePerson
()
self
.
computer
.
edit
(
source_administration
=
self
.
person_user
.
getRelativeUrl
())
self
.
computer
.
edit
(
source_administration
=
self
.
person_user
.
getRelativeUrl
())
self
.
tic
()
self
.
tic
()
self
.
login
(
self
.
person_user
.
get
Reference
())
self
.
login
(
self
.
person_user
.
get
UserId
())
self
.
assertRaises
(
TypeError
,
self
.
computer
.
requestSoftwareRelease
,
self
.
assertRaises
(
TypeError
,
self
.
computer
.
requestSoftwareRelease
,
state
=
'available'
)
state
=
'available'
)
transaction
.
abort
()
transaction
.
abort
()
...
@@ -242,7 +242,7 @@ class TestSlapOSCoreComputerSlapInterfaceWorkflow(testSlapOSMixin):
...
@@ -242,7 +242,7 @@ class TestSlapOSCoreComputerSlapInterfaceWorkflow(testSlapOSMixin):
self
.
_makePerson
()
self
.
_makePerson
()
self
.
computer
.
edit
(
source_administration
=
self
.
person_user
.
getRelativeUrl
())
self
.
computer
.
edit
(
source_administration
=
self
.
person_user
.
getRelativeUrl
())
self
.
tic
()
self
.
tic
()
self
.
login
(
self
.
person_user
.
get
Reference
())
self
.
login
(
self
.
person_user
.
get
UserId
())
url
=
self
.
generateNewSoftwareReleaseUrl
()
url
=
self
.
generateNewSoftwareReleaseUrl
()
self
.
assertRaises
(
TypeError
,
self
.
computer
.
requestSoftwareRelease
,
self
.
assertRaises
(
TypeError
,
self
.
computer
.
requestSoftwareRelease
,
software_release_url
=
url
)
software_release_url
=
url
)
...
@@ -252,7 +252,7 @@ class TestSlapOSCoreComputerSlapInterfaceWorkflow(testSlapOSMixin):
...
@@ -252,7 +252,7 @@ class TestSlapOSCoreComputerSlapInterfaceWorkflow(testSlapOSMixin):
self
.
_makePerson
()
self
.
_makePerson
()
self
.
computer
.
edit
(
source_administration
=
self
.
person_user
.
getRelativeUrl
())
self
.
computer
.
edit
(
source_administration
=
self
.
person_user
.
getRelativeUrl
())
self
.
tic
()
self
.
tic
()
self
.
login
(
self
.
person_user
.
get
Reference
())
self
.
login
(
self
.
person_user
.
get
UserId
())
url
=
self
.
generateNewSoftwareReleaseUrl
()
url
=
self
.
generateNewSoftwareReleaseUrl
()
self
.
computer
.
requestSoftwareRelease
(
software_release_url
=
url
,
self
.
computer
.
requestSoftwareRelease
(
software_release_url
=
url
,
state
=
'available'
)
state
=
'available'
)
...
@@ -268,7 +268,7 @@ class TestSlapOSCoreComputerSlapInterfaceWorkflow(testSlapOSMixin):
...
@@ -268,7 +268,7 @@ class TestSlapOSCoreComputerSlapInterfaceWorkflow(testSlapOSMixin):
self
.
_makePerson
()
self
.
_makePerson
()
self
.
computer
.
edit
(
source_administration
=
self
.
person_user
.
getRelativeUrl
())
self
.
computer
.
edit
(
source_administration
=
self
.
person_user
.
getRelativeUrl
())
self
.
tic
()
self
.
tic
()
self
.
login
(
self
.
person_user
.
get
Reference
())
self
.
login
(
self
.
person_user
.
get
UserId
())
url
=
self
.
generateNewSoftwareReleaseUrl
()
url
=
self
.
generateNewSoftwareReleaseUrl
()
self
.
computer
.
requestSoftwareRelease
(
software_release_url
=
url
,
self
.
computer
.
requestSoftwareRelease
(
software_release_url
=
url
,
state
=
'destroyed'
)
state
=
'destroyed'
)
...
@@ -282,7 +282,7 @@ class TestSlapOSCoreComputerSlapInterfaceWorkflow(testSlapOSMixin):
...
@@ -282,7 +282,7 @@ class TestSlapOSCoreComputerSlapInterfaceWorkflow(testSlapOSMixin):
self
.
_makePerson
()
self
.
_makePerson
()
self
.
computer
.
edit
(
source_administration
=
self
.
person_user
.
getRelativeUrl
())
self
.
computer
.
edit
(
source_administration
=
self
.
person_user
.
getRelativeUrl
())
self
.
tic
()
self
.
tic
()
self
.
login
(
self
.
person_user
.
get
Reference
())
self
.
login
(
self
.
person_user
.
get
UserId
())
url
=
self
.
generateNewSoftwareReleaseUrl
()
url
=
self
.
generateNewSoftwareReleaseUrl
()
self
.
computer
.
requestSoftwareRelease
(
software_release_url
=
url
,
self
.
computer
.
requestSoftwareRelease
(
software_release_url
=
url
,
state
=
'available'
)
state
=
'available'
)
...
@@ -310,7 +310,7 @@ class TestSlapOSCoreComputerSlapInterfaceWorkflow(testSlapOSMixin):
...
@@ -310,7 +310,7 @@ class TestSlapOSCoreComputerSlapInterfaceWorkflow(testSlapOSMixin):
self
.
_makePerson
()
self
.
_makePerson
()
self
.
computer
.
edit
(
source_administration
=
self
.
person_user
.
getRelativeUrl
())
self
.
computer
.
edit
(
source_administration
=
self
.
person_user
.
getRelativeUrl
())
self
.
tic
()
self
.
tic
()
self
.
login
(
self
.
person_user
.
get
Reference
())
self
.
login
(
self
.
person_user
.
get
UserId
())
url
=
self
.
generateNewSoftwareReleaseUrl
()
url
=
self
.
generateNewSoftwareReleaseUrl
()
self
.
computer
.
requestSoftwareRelease
(
software_release_url
=
url
,
self
.
computer
.
requestSoftwareRelease
(
software_release_url
=
url
,
state
=
'available'
)
state
=
'available'
)
...
@@ -325,7 +325,7 @@ class TestSlapOSCoreComputerSlapInterfaceWorkflow(testSlapOSMixin):
...
@@ -325,7 +325,7 @@ class TestSlapOSCoreComputerSlapInterfaceWorkflow(testSlapOSMixin):
self
.
_makePerson
()
self
.
_makePerson
()
self
.
computer
.
edit
(
source_administration
=
self
.
person_user
.
getRelativeUrl
())
self
.
computer
.
edit
(
source_administration
=
self
.
person_user
.
getRelativeUrl
())
self
.
tic
()
self
.
tic
()
self
.
login
(
self
.
person_user
.
get
Reference
())
self
.
login
(
self
.
person_user
.
get
UserId
())
url
=
self
.
generateNewSoftwareReleaseUrl
()
url
=
self
.
generateNewSoftwareReleaseUrl
()
self
.
computer
.
requestSoftwareRelease
(
software_release_url
=
url
,
self
.
computer
.
requestSoftwareRelease
(
software_release_url
=
url
,
state
=
'available'
)
state
=
'available'
)
...
@@ -416,7 +416,7 @@ class TestSlapOSCorePersonComputerSupply(testSlapOSMixin):
...
@@ -416,7 +416,7 @@ class TestSlapOSCorePersonComputerSupply(testSlapOSMixin):
self
.
tic
()
self
.
tic
()
# Login as new user
# Login as new user
self
.
login
(
person_user
.
get
Reference
())
self
.
login
(
person_user
.
get
UserId
())
new_person
=
self
.
getPortalObject
().
ERP5Site_getAuthenticatedMemberPersonValue
()
new_person
=
self
.
getPortalObject
().
ERP5Site_getAuthenticatedMemberPersonValue
()
self
.
assertEquals
(
person_user
.
getRelativeUrl
(),
new_person
.
getRelativeUrl
())
self
.
assertEquals
(
person_user
.
getRelativeUrl
(),
new_person
.
getRelativeUrl
())
...
@@ -1958,7 +1958,7 @@ class TestSlapOSCorePersonRequest(testSlapOSMixin):
...
@@ -1958,7 +1958,7 @@ class TestSlapOSCorePersonRequest(testSlapOSMixin):
self
.
tic
()
self
.
tic
()
# Login as new user
# Login as new user
self
.
login
(
person_user
.
get
Reference
())
self
.
login
(
person_user
.
get
UserId
())
new_person
=
self
.
getPortalObject
().
ERP5Site_getAuthenticatedMemberPersonValue
()
new_person
=
self
.
getPortalObject
().
ERP5Site_getAuthenticatedMemberPersonValue
()
self
.
assertEquals
(
person_user
.
getRelativeUrl
(),
new_person
.
getRelativeUrl
())
self
.
assertEquals
(
person_user
.
getRelativeUrl
(),
new_person
.
getRelativeUrl
())
...
@@ -2520,7 +2520,7 @@ class TestSlapOSCorePersonRequestComputer(testSlapOSMixin):
...
@@ -2520,7 +2520,7 @@ class TestSlapOSCorePersonRequestComputer(testSlapOSMixin):
self
.
tic
()
self
.
tic
()
# Login as new user
# Login as new user
self
.
login
(
person_user
.
get
Reference
())
self
.
login
(
person_user
.
get
UserId
())
new_person
=
self
.
getPortalObject
().
ERP5Site_getAuthenticatedMemberPersonValue
()
new_person
=
self
.
getPortalObject
().
ERP5Site_getAuthenticatedMemberPersonValue
()
self
.
assertEquals
(
person_user
.
getRelativeUrl
(),
new_person
.
getRelativeUrl
())
self
.
assertEquals
(
person_user
.
getRelativeUrl
(),
new_person
.
getRelativeUrl
())
...
@@ -2726,7 +2726,7 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(testSlapOSMixin):
...
@@ -2726,7 +2726,7 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(testSlapOSMixin):
def
test_Computer_setSubjectList
(
self
):
def
test_Computer_setSubjectList
(
self
):
self
.
_makePerson
()
self
.
_makePerson
()
self
.
login
(
self
.
person_user
.
get
Reference
())
self
.
login
(
self
.
person_user
.
get
UserId
())
new_id
=
self
.
generateNewId
()
new_id
=
self
.
generateNewId
()
computer
=
self
.
portal
.
computer_module
.
newContent
(
computer
=
self
.
portal
.
computer_module
.
newContent
(
...
@@ -2743,7 +2743,7 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(testSlapOSMixin):
...
@@ -2743,7 +2743,7 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(testSlapOSMixin):
def
check_Instance_validate
(
self
,
portal_type
):
def
check_Instance_validate
(
self
,
portal_type
):
self
.
_makePerson
()
self
.
_makePerson
()
self
.
login
(
self
.
person_user
.
get
Reference
())
self
.
login
(
self
.
person_user
.
get
UserId
())
new_id
=
self
.
generateNewId
()
new_id
=
self
.
generateNewId
()
instance
=
self
.
portal
.
software_instance_module
.
newContent
(
instance
=
self
.
portal
.
software_instance_module
.
newContent
(
...
@@ -2759,7 +2759,9 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(testSlapOSMixin):
...
@@ -2759,7 +2759,9 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(testSlapOSMixin):
return
self
.
activeSense_call
()
return
self
.
activeSense_call
()
# Replace activeSense by a dummy method
# 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_call
=
Alarm
.
activeSense
Alarm
.
activeSense
=
verify_activeSense_call
Alarm
.
activeSense
=
verify_activeSense_call
try
:
try
:
...
@@ -2780,7 +2782,7 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(testSlapOSMixin):
...
@@ -2780,7 +2782,7 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(testSlapOSMixin):
def
test_SlaveInstance_requestDestroy
(
self
):
def
test_SlaveInstance_requestDestroy
(
self
):
self
.
_makePerson
()
self
.
_makePerson
()
self
.
login
(
self
.
person_user
.
get
Reference
())
self
.
login
(
self
.
person_user
.
get
UserId
())
new_id
=
self
.
generateNewId
()
new_id
=
self
.
generateNewId
()
instance
=
self
.
portal
.
software_instance_module
.
newContent
(
instance
=
self
.
portal
.
software_instance_module
.
newContent
(
portal_type
=
'Slave Instance'
,
portal_type
=
'Slave Instance'
,
...
@@ -2804,7 +2806,7 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(testSlapOSMixin):
...
@@ -2804,7 +2806,7 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(testSlapOSMixin):
def
check_SoftwareInstallation_changeState
(
self
,
method_id
):
def
check_SoftwareInstallation_changeState
(
self
,
method_id
):
self
.
_makePerson
()
self
.
_makePerson
()
self
.
login
(
self
.
person_user
.
get
Reference
())
self
.
login
(
self
.
person_user
.
get
UserId
())
new_id
=
self
.
generateNewId
()
new_id
=
self
.
generateNewId
()
computer
=
self
.
portal
.
computer_module
.
newContent
(
computer
=
self
.
portal
.
computer_module
.
newContent
(
portal_type
=
'Computer'
,
portal_type
=
'Computer'
,
...
@@ -2845,7 +2847,7 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(testSlapOSMixin):
...
@@ -2845,7 +2847,7 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(testSlapOSMixin):
def
check_SoftwareInstance_changeState
(
self
,
method_id
):
def
check_SoftwareInstance_changeState
(
self
,
method_id
):
self
.
_makePerson
()
self
.
_makePerson
()
self
.
login
(
self
.
person_user
.
get
Reference
())
self
.
login
(
self
.
person_user
.
get
UserId
())
new_id
=
self
.
generateNewId
()
new_id
=
self
.
generateNewId
()
computer
=
self
.
portal
.
computer_module
.
newContent
(
computer
=
self
.
portal
.
computer_module
.
newContent
(
...
@@ -2909,7 +2911,7 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(testSlapOSMixin):
...
@@ -2909,7 +2911,7 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(testSlapOSMixin):
def
check_change_instance_parameter
(
self
,
portal_type
,
method_id
):
def
check_change_instance_parameter
(
self
,
portal_type
,
method_id
):
self
.
_makePerson
()
self
.
_makePerson
()
self
.
login
(
self
.
person_user
.
get
Reference
())
self
.
login
(
self
.
person_user
.
get
UserId
())
new_id
=
self
.
generateNewId
()
new_id
=
self
.
generateNewId
()
instance
=
self
.
portal
.
software_instance_module
.
newContent
(
instance
=
self
.
portal
.
software_instance_module
.
newContent
(
...
@@ -2966,7 +2968,7 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(testSlapOSMixin):
...
@@ -2966,7 +2968,7 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(testSlapOSMixin):
portal_type
=
"Software Instance"
portal_type
=
"Software Instance"
self
.
_makePerson
()
self
.
_makePerson
()
self
.
login
(
self
.
person_user
.
get
Reference
())
self
.
login
(
self
.
person_user
.
get
UserId
())
new_id
=
self
.
generateNewId
()
new_id
=
self
.
generateNewId
()
instance3
=
self
.
portal
.
software_instance_module
.
newContent
(
instance3
=
self
.
portal
.
software_instance_module
.
newContent
(
...
...
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudWorkflow.xml
View file @
be462165
...
@@ -6,10 +6,22 @@
...
@@ -6,10 +6,22 @@
</pickle>
</pickle>
<pickle>
<pickle>
<dictionary>
<dictionary>
<item>
<key>
<string>
_recorded_property_dict
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<item>
<key>
<string>
default_reference
</string>
</key>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
testSlapOSCloudWorkflow
</string>
</value>
<value>
<string>
testSlapOSCloudWorkflow
</string>
</value>
</item>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<item>
<key>
<string>
id
</string>
</key>
<key>
<string>
id
</string>
</key>
<value>
<string>
test.erp5.testSlapOSCloudWorkflow
</string>
</value>
<value>
<string>
test.erp5.testSlapOSCloudWorkflow
</string>
</value>
...
@@ -27,9 +39,7 @@
...
@@ -27,9 +39,7 @@
<item>
<item>
<key>
<string>
text_content_error_message
</string>
</key>
<key>
<string>
text_content_error_message
</string>
</key>
<value>
<value>
<tuple>
<tuple/>
<string>
F:2762, 4: Unable to import \'Products.ERP5Type.Document.Alarm\' (import-error)
</string>
</tuple>
</value>
</value>
</item>
</item>
<item>
<item>
...
@@ -45,13 +55,28 @@
...
@@ -45,13 +55,28 @@
<item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<key>
<string>
workflow_history
</string>
</key>
<value>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
I
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
</value>
</value>
</item>
</item>
</dictionary>
</dictionary>
</pickle>
</pickle>
</record>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<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>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
</pickle>
...
@@ -64,7 +89,7 @@
...
@@ -64,7 +89,7 @@
<item>
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
Q
=
</string>
</persistent>
</value>
</value>
</item>
</item>
</dictionary>
</dictionary>
...
@@ -73,7 +98,7 @@
...
@@ -73,7 +98,7 @@
</dictionary>
</dictionary>
</pickle>
</pickle>
</record>
</record>
<record
id=
"
3"
aka=
"AAAAAAAAAAM
="
>
<record
id=
"
4"
aka=
"AAAAAAAAAAQ
="
>
<pickle>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.patches.WorkflowTool"
/>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.patches.WorkflowTool"
/>
</pickle>
</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