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
Eric Zheng
slapos.core
Commits
698b2580
Commit
698b2580
authored
Dec 04, 2018
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_*:Replace recursiveImmediateReindexObject by self.commit() on tests
parent
61b5a31b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
19 deletions
+12
-19
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudSecurityGroup.py
...rtal_components/test.erp5.testSlapOSCloudSecurityGroup.py
+6
-10
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudShadow.py
...Item/portal_components/test.erp5.testSlapOSCloudShadow.py
+4
-6
master/bt5/slapos_slap_tool/TestTemplateItem/portal_components/test.erp5.testSlapOSSlapTool.py
...ateItem/portal_components/test.erp5.testSlapOSSlapTool.py
+2
-3
No files found.
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudSecurityGroup.py
View file @
698b2580
...
@@ -93,7 +93,7 @@ class TestSlapOSComputerSecurity(TestSlapOSSecurityMixin):
...
@@ -93,7 +93,7 @@ class TestSlapOSComputerSecurity(TestSlapOSSecurityMixin):
computer
.
newContent
(
portal_type
=
'ERP5 Login'
,
computer
.
newContent
(
portal_type
=
'ERP5 Login'
,
reference
=
reference
).
validate
()
reference
=
reference
).
validate
()
computer
.
recursiveImmediateReindexObjec
t
()
self
.
commi
t
()
self
.
_assertUserExists
(
user_id
,
reference
,
None
)
self
.
_assertUserExists
(
user_id
,
reference
,
None
)
...
@@ -112,7 +112,7 @@ class TestSlapOSComputerSecurity(TestSlapOSSecurityMixin):
...
@@ -112,7 +112,7 @@ class TestSlapOSComputerSecurity(TestSlapOSSecurityMixin):
computer
.
setUserId
(
user_id
)
computer
.
setUserId
(
user_id
)
computer
.
newContent
(
portal_type
=
'ERP5 Login'
,
computer
.
newContent
(
portal_type
=
'ERP5 Login'
,
reference
=
reference
)
reference
=
reference
)
computer
.
recursiveImmediateReindexObjec
t
()
self
.
commi
t
()
self
.
_assertUserDoesNotExists
(
user_id
,
reference
,
None
)
self
.
_assertUserDoesNotExists
(
user_id
,
reference
,
None
)
...
@@ -128,7 +128,7 @@ class TestSlapOSSoftwareInstanceSecurity(TestSlapOSSecurityMixin):
...
@@ -128,7 +128,7 @@ class TestSlapOSSoftwareInstanceSecurity(TestSlapOSSecurityMixin):
instance
.
validate
()
instance
.
validate
()
instance
.
newContent
(
portal_type
=
'ERP5 Login'
,
instance
.
newContent
(
portal_type
=
'ERP5 Login'
,
reference
=
reference
).
validate
()
reference
=
reference
).
validate
()
instance
.
recursiveImmediateReindexObjec
t
()
self
.
commi
t
()
self
.
_assertUserExists
(
user_id
,
reference
,
None
)
self
.
_assertUserExists
(
user_id
,
reference
,
None
)
...
@@ -147,8 +147,7 @@ class TestSlapOSSoftwareInstanceSecurity(TestSlapOSSecurityMixin):
...
@@ -147,8 +147,7 @@ class TestSlapOSSoftwareInstanceSecurity(TestSlapOSSecurityMixin):
reference
=
subscription_reference
)
reference
=
subscription_reference
)
subscription
.
validate
()
subscription
.
validate
()
instance
.
setSpecialise
(
subscription
.
getRelativeUrl
())
instance
.
setSpecialise
(
subscription
.
getRelativeUrl
())
subscription
.
recursiveImmediateReindexObject
()
self
.
commit
()
instance
.
recursiveImmediateReindexObject
()
# clear cache in order to reset calculation
# clear cache in order to reset calculation
self
.
portal
.
portal_caches
.
clearAllCache
()
self
.
portal
.
portal_caches
.
clearAllCache
()
...
@@ -165,7 +164,7 @@ class TestSlapOSSoftwareInstanceSecurity(TestSlapOSSecurityMixin):
...
@@ -165,7 +164,7 @@ class TestSlapOSSoftwareInstanceSecurity(TestSlapOSSecurityMixin):
instance
=
self
.
portal
.
getDefaultModule
(
portal_type
=
self
.
portal_type
)
\
instance
=
self
.
portal
.
getDefaultModule
(
portal_type
=
self
.
portal_type
)
\
.
newContent
(
portal_type
=
self
.
portal_type
,
reference
=
reference
)
.
newContent
(
portal_type
=
self
.
portal_type
,
reference
=
reference
)
instance
.
setUserId
(
user_id
)
instance
.
setUserId
(
user_id
)
instance
.
recursiveImmediateReindexObjec
t
()
self
.
commi
t
()
self
.
_assertUserDoesNotExists
(
user_id
,
reference
,
None
)
self
.
_assertUserDoesNotExists
(
user_id
,
reference
,
None
)
...
@@ -185,7 +184,6 @@ class TestSlapOSPersonSecurity(TestSlapOSSecurityMixin):
...
@@ -185,7 +184,6 @@ class TestSlapOSPersonSecurity(TestSlapOSSecurityMixin):
reference
=
reference
,
password
=
password
).
validate
()
reference
=
reference
,
password
=
password
).
validate
()
self
.
commit
()
self
.
commit
()
person
.
recursiveImmediateReindexObject
()
self
.
_assertUserExists
(
user_id
,
reference
,
password
)
self
.
_assertUserExists
(
user_id
,
reference
,
password
)
...
@@ -199,7 +197,6 @@ class TestSlapOSPersonSecurity(TestSlapOSSecurityMixin):
...
@@ -199,7 +197,6 @@ class TestSlapOSPersonSecurity(TestSlapOSSecurityMixin):
self
.
login
()
self
.
login
()
person
.
newContent
(
portal_type
=
'Assignment'
,
group
=
'company'
).
open
()
person
.
newContent
(
portal_type
=
'Assignment'
,
group
=
'company'
).
open
()
self
.
commit
()
self
.
commit
()
person
.
recursiveImmediateReindexObject
()
self
.
tic
()
self
.
tic
()
self
.
portal
.
portal_caches
.
clearAllCache
()
self
.
portal
.
portal_caches
.
clearAllCache
()
...
@@ -211,7 +208,7 @@ class TestSlapOSPersonSecurity(TestSlapOSSecurityMixin):
...
@@ -211,7 +208,7 @@ class TestSlapOSPersonSecurity(TestSlapOSSecurityMixin):
# add to role category
# add to role category
self
.
login
()
self
.
login
()
person
.
newContent
(
portal_type
=
'Assignment'
,
role
=
'member'
).
open
()
person
.
newContent
(
portal_type
=
'Assignment'
,
role
=
'member'
).
open
()
person
.
recursiveImmediateReindexObjec
t
()
self
.
commi
t
()
self
.
portal
.
portal_caches
.
clearAllCache
()
self
.
portal
.
portal_caches
.
clearAllCache
()
self
.
login
(
person
.
getUserId
())
self
.
login
(
person
.
getUserId
())
...
@@ -228,7 +225,6 @@ class TestSlapOSPersonSecurity(TestSlapOSSecurityMixin):
...
@@ -228,7 +225,6 @@ class TestSlapOSPersonSecurity(TestSlapOSSecurityMixin):
reference
=
reference
,
password
=
password
)
reference
=
reference
,
password
=
password
)
self
.
commit
()
self
.
commit
()
person
.
recursiveImmediateReindexObject
()
self
.
_assertUserDoesNotExists
(
user_id
,
reference
,
password
)
self
.
_assertUserDoesNotExists
(
user_id
,
reference
,
password
)
...
...
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudShadow.py
View file @
698b2580
...
@@ -46,7 +46,6 @@ class TestSlapOSShadowPerson(TestSlapOSSecurityMixin):
...
@@ -46,7 +46,6 @@ class TestSlapOSShadowPerson(TestSlapOSSecurityMixin):
person
.
newContent
(
portal_type
=
'ERP5 Login'
,
person
.
newContent
(
portal_type
=
'ERP5 Login'
,
reference
=
reference
,
password
=
password
).
validate
()
reference
=
reference
,
password
=
password
).
validate
()
self
.
commit
()
self
.
commit
()
person
.
recursiveImmediateReindexObject
()
self
.
_assertUserExists
(
user_id
,
reference
,
password
)
self
.
_assertUserExists
(
user_id
,
reference
,
password
)
...
@@ -70,7 +69,6 @@ class TestSlapOSShadowPerson(TestSlapOSSecurityMixin):
...
@@ -70,7 +69,6 @@ class TestSlapOSShadowPerson(TestSlapOSSecurityMixin):
person
.
setUserId
(
user_id
)
person
.
setUserId
(
user_id
)
self
.
commit
()
self
.
commit
()
person
.
recursiveImmediateReindexObject
()
self
.
_assertUserDoesNotExists
(
user_id
,
reference
,
password
)
self
.
_assertUserDoesNotExists
(
user_id
,
reference
,
password
)
self
.
_assertUserDoesNotExists
(
shadow_user_id
,
reference
,
None
)
self
.
_assertUserDoesNotExists
(
shadow_user_id
,
reference
,
None
)
...
@@ -90,7 +88,7 @@ class TestSlapOSShadowComputer(TestSlapOSSecurityMixin):
...
@@ -90,7 +88,7 @@ class TestSlapOSShadowComputer(TestSlapOSSecurityMixin):
reference
=
reference
).
validate
()
reference
=
reference
).
validate
()
computer
.
validate
()
computer
.
validate
()
computer
.
recursiveImmediateReindexObjec
t
()
self
.
commi
t
()
self
.
_assertUserExists
(
user_id
,
reference
,
None
)
self
.
_assertUserExists
(
user_id
,
reference
,
None
)
self
.
_assertUserExists
(
shadow_user_id
,
reference
,
None
)
self
.
_assertUserExists
(
shadow_user_id
,
reference
,
None
)
...
@@ -111,7 +109,7 @@ class TestSlapOSShadowComputer(TestSlapOSSecurityMixin):
...
@@ -111,7 +109,7 @@ class TestSlapOSShadowComputer(TestSlapOSSecurityMixin):
reference
=
reference
)
reference
=
reference
)
computer
.
setUserId
(
user_id
)
computer
.
setUserId
(
user_id
)
computer
.
recursiveImmediateReindexObjec
t
()
self
.
commi
t
()
self
.
_assertUserDoesNotExists
(
user_id
,
reference
,
None
)
self
.
_assertUserDoesNotExists
(
user_id
,
reference
,
None
)
self
.
_assertUserDoesNotExists
(
user_id
,
shadow_reference
,
None
)
self
.
_assertUserDoesNotExists
(
user_id
,
shadow_reference
,
None
)
...
@@ -130,7 +128,7 @@ class TestSlapOSShadowSoftwareInstance(TestSlapOSSecurityMixin):
...
@@ -130,7 +128,7 @@ class TestSlapOSShadowSoftwareInstance(TestSlapOSSecurityMixin):
instance
.
newContent
(
portal_type
=
'ERP5 Login'
,
instance
.
newContent
(
portal_type
=
'ERP5 Login'
,
reference
=
reference
).
validate
()
reference
=
reference
).
validate
()
instance
.
validate
()
instance
.
validate
()
instance
.
recursiveImmediateReindexObjec
t
()
self
.
commi
t
()
self
.
_assertUserExists
(
user_id
,
reference
,
None
)
self
.
_assertUserExists
(
user_id
,
reference
,
None
)
self
.
_assertUserExists
(
shadow_user_id
,
reference
,
None
)
self
.
_assertUserExists
(
shadow_user_id
,
reference
,
None
)
...
@@ -150,7 +148,7 @@ class TestSlapOSShadowSoftwareInstance(TestSlapOSSecurityMixin):
...
@@ -150,7 +148,7 @@ class TestSlapOSShadowSoftwareInstance(TestSlapOSSecurityMixin):
instance
=
self
.
portal
.
getDefaultModule
(
portal_type
=
self
.
portal_type
)
\
instance
=
self
.
portal
.
getDefaultModule
(
portal_type
=
self
.
portal_type
)
\
.
newContent
(
portal_type
=
self
.
portal_type
,
reference
=
reference
)
.
newContent
(
portal_type
=
self
.
portal_type
,
reference
=
reference
)
instance
.
setUserId
(
user_id
)
instance
.
setUserId
(
user_id
)
instance
.
recursiveImmediateReindexObjec
t
()
self
.
commi
t
()
self
.
_assertUserDoesNotExists
(
user_id
,
reference
,
None
)
self
.
_assertUserDoesNotExists
(
user_id
,
reference
,
None
)
self
.
_assertUserDoesNotExists
(
user_id
,
shadow_reference
,
None
)
self
.
_assertUserDoesNotExists
(
user_id
,
shadow_reference
,
None
)
...
...
master/bt5/slapos_slap_tool/TestTemplateItem/portal_components/test.erp5.testSlapOSSlapTool.py
View file @
698b2580
...
@@ -2085,8 +2085,7 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSSlapToolMixin):
...
@@ -2085,8 +2085,7 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSSlapToolMixin):
person
.
newContent
(
portal_type
=
'Assignment'
,
role
=
'member'
).
open
()
person
.
newContent
(
portal_type
=
'Assignment'
,
role
=
'member'
).
open
()
person
.
newContent
(
portal_type
=
'ERP5 Login'
,
reference
=
reference
).
validate
()
person
.
newContent
(
portal_type
=
'ERP5 Login'
,
reference
=
reference
).
validate
()
transaction
.
commit
()
self
.
commit
()
person
.
recursiveImmediateReindexObject
()
self
.
person
=
person
self
.
person
=
person
self
.
person_reference
=
person
.
getReference
()
self
.
person_reference
=
person
.
getReference
()
self
.
person_user_id
=
person
.
getUserId
()
self
.
person_user_id
=
person
.
getUserId
()
...
...
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