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
85e411bf
Commit
85e411bf
authored
Aug 19, 2020
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_erp5&cloud: Reuse Person_generatePassword on Tests
We don't need to generate password everywhere
parent
91e4fb57
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
23 deletions
+27
-23
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.SlapOSTestCaseMixin.py
...teItem/portal_components/test.erp5.SlapOSTestCaseMixin.py
+1
-1
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudSecurityGroup.py
...rtal_components/test.erp5.testSlapOSCloudSecurityGroup.py
+3
-3
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudSecurityGroup.xml
...tal_components/test.erp5.testSlapOSCloudSecurityGroup.xml
+20
-16
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSAuthenticationPolicy.py
...al_components/test.erp5.testSlapOSAuthenticationPolicy.py
+3
-3
No files found.
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.SlapOSTestCaseMixin.py
View file @
85e411bf
...
...
@@ -131,7 +131,7 @@ class SlapOSTestCaseMixin(testSlapOSMixin):
def
_addERP5Login
(
self
,
document
,
**
kw
):
if
document
.
getPortalType
()
==
"Person"
:
kw
[
"password"
]
=
"%s-aA$1"
%
self
.
generateNewI
d
()
kw
[
"password"
]
=
document
.
Person_generatePasswor
d
()
login
=
document
.
newContent
(
portal_type
=
"ERP5 Login"
,
reference
=
document
.
getReference
(),
...
...
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudSecurityGroup.py
View file @
85e411bf
...
...
@@ -182,8 +182,7 @@ class TestSlapOSSoftwareInstanceSecurity(TestSlapOSSecurityMixin):
self
.
test_inactive
(
login_portal_type
=
"ERP5 Login"
)
class
TestSlapOSPersonSecurity
(
TestSlapOSSecurityMixin
):
def
test_active
(
self
,
login_portal_type
=
"Certificate Login"
):
password
=
'%s-aA1$'
%
str
(
random
.
random
())
def
test_active
(
self
,
login_portal_type
=
"Certificate Login"
):
reference
=
self
.
_generateRandomUniqueReference
(
'Person'
)
user_id
=
self
.
_generateRandomUniqueUserId
(
'Person'
)
...
...
@@ -192,6 +191,7 @@ class TestSlapOSPersonSecurity(TestSlapOSSecurityMixin):
reference
=
reference
)
person
.
setUserId
(
user_id
)
password
=
person
.
Person_generatePassword
()
person
.
newContent
(
portal_type
=
'Assignment'
).
open
()
if
login_portal_type
==
"ERP5 Login"
:
person
.
newContent
(
portal_type
=
login_portal_type
,
...
...
@@ -235,12 +235,12 @@ class TestSlapOSPersonSecurity(TestSlapOSSecurityMixin):
self
.
assertSameSet
([
'R-MEMBER'
,
'G-COMPANY'
],
user
.
getGroups
())
def
test_inactive
(
self
,
login_portal_type
=
"Certificate Login"
):
password
=
'%s-aA1$'
%
str
(
random
.
random
())
reference
=
self
.
_generateRandomUniqueReference
(
'Person'
)
user_id
=
self
.
_generateRandomUniqueReference
(
'Person'
)
person
=
self
.
portal
.
person_module
.
newContent
(
portal_type
=
'Person'
,
reference
=
reference
)
password
=
person
.
Person_generatePassword
()
self
.
tic
()
...
...
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudSecurityGroup.xml
View file @
85e411bf
...
...
@@ -100,24 +100,28 @@
</record>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
patches.WorkflowTool
"
/>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
Workflow
"
/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</tuple>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSAuthenticationPolicy.py
View file @
85e411bf
...
...
@@ -84,7 +84,7 @@ class TestSlapOSAuthenticationPolicyL(SlapOSTestCaseMixin):
self
.
assertFalse
(
login
.
isLoginBlocked
())
# Password should be ignored
login
.
setPassword
(
"%s-aA$1"
%
self
.
generateNewI
d
())
login
.
setPassword
(
document
.
Person_generatePasswor
d
())
self
.
_clearCache
()
self
.
tic
()
...
...
@@ -197,7 +197,7 @@ class TestSlapOSAuthenticationPolicyL(SlapOSTestCaseMixin):
login_portal_type
=
login_portal_type
)
login
.
setPassword
(
"%s-aA$1"
%
self
.
generateNewI
d
())
login
.
setPassword
(
document
.
Person_generatePasswor
d
())
self
.
system_preference
.
setPreferredMaxPasswordLifetimeDuration
(
0
)
self
.
_clearCache
()
self
.
assertTrue
(
login
.
isPasswordExpired
())
...
...
@@ -208,7 +208,7 @@ class TestSlapOSAuthenticationPolicyL(SlapOSTestCaseMixin):
login_portal_type
=
login_portal_type
)
login
.
setPassword
(
"%s-aA$1"
%
self
.
generateNewI
d
())
login
.
setPassword
(
document
.
Person_generatePasswor
d
())
self
.
system_preference
.
setPreferredMaxPasswordLifetimeDuration
(
0
)
self
.
_clearCache
()
self
.
assertFalse
(
login
.
isPasswordExpired
())
...
...
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