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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
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):
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
())
...
...
@@ -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
())
...
...
@@ -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
(
...
...
@@ -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
(
...
...
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