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
Ophélie Gagnard
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
Show 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):
...
@@ -131,7 +131,7 @@ class SlapOSTestCaseMixin(testSlapOSMixin):
def
_addERP5Login
(
self
,
document
,
**
kw
):
def
_addERP5Login
(
self
,
document
,
**
kw
):
if
document
.
getPortalType
()
==
"Person"
:
if
document
.
getPortalType
()
==
"Person"
:
kw
[
"password"
]
=
"%s-aA$1"
%
self
.
generateNewI
d
()
kw
[
"password"
]
=
document
.
Person_generatePasswor
d
()
login
=
document
.
newContent
(
login
=
document
.
newContent
(
portal_type
=
"ERP5 Login"
,
portal_type
=
"ERP5 Login"
,
reference
=
document
.
getReference
(),
reference
=
document
.
getReference
(),
...
...
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudSecurityGroup.py
View file @
85e411bf
...
@@ -183,7 +183,6 @@ class TestSlapOSSoftwareInstanceSecurity(TestSlapOSSecurityMixin):
...
@@ -183,7 +183,6 @@ class TestSlapOSSoftwareInstanceSecurity(TestSlapOSSecurityMixin):
class
TestSlapOSPersonSecurity
(
TestSlapOSSecurityMixin
):
class
TestSlapOSPersonSecurity
(
TestSlapOSSecurityMixin
):
def
test_active
(
self
,
login_portal_type
=
"Certificate Login"
):
def
test_active
(
self
,
login_portal_type
=
"Certificate Login"
):
password
=
'%s-aA1$'
%
str
(
random
.
random
())
reference
=
self
.
_generateRandomUniqueReference
(
'Person'
)
reference
=
self
.
_generateRandomUniqueReference
(
'Person'
)
user_id
=
self
.
_generateRandomUniqueUserId
(
'Person'
)
user_id
=
self
.
_generateRandomUniqueUserId
(
'Person'
)
...
@@ -192,6 +191,7 @@ class TestSlapOSPersonSecurity(TestSlapOSSecurityMixin):
...
@@ -192,6 +191,7 @@ class TestSlapOSPersonSecurity(TestSlapOSSecurityMixin):
reference
=
reference
)
reference
=
reference
)
person
.
setUserId
(
user_id
)
person
.
setUserId
(
user_id
)
password
=
person
.
Person_generatePassword
()
person
.
newContent
(
portal_type
=
'Assignment'
).
open
()
person
.
newContent
(
portal_type
=
'Assignment'
).
open
()
if
login_portal_type
==
"ERP5 Login"
:
if
login_portal_type
==
"ERP5 Login"
:
person
.
newContent
(
portal_type
=
login_portal_type
,
person
.
newContent
(
portal_type
=
login_portal_type
,
...
@@ -235,12 +235,12 @@ class TestSlapOSPersonSecurity(TestSlapOSSecurityMixin):
...
@@ -235,12 +235,12 @@ class TestSlapOSPersonSecurity(TestSlapOSSecurityMixin):
self
.
assertSameSet
([
'R-MEMBER'
,
'G-COMPANY'
],
user
.
getGroups
())
self
.
assertSameSet
([
'R-MEMBER'
,
'G-COMPANY'
],
user
.
getGroups
())
def
test_inactive
(
self
,
login_portal_type
=
"Certificate Login"
):
def
test_inactive
(
self
,
login_portal_type
=
"Certificate Login"
):
password
=
'%s-aA1$'
%
str
(
random
.
random
())
reference
=
self
.
_generateRandomUniqueReference
(
'Person'
)
reference
=
self
.
_generateRandomUniqueReference
(
'Person'
)
user_id
=
self
.
_generateRandomUniqueReference
(
'Person'
)
user_id
=
self
.
_generateRandomUniqueReference
(
'Person'
)
person
=
self
.
portal
.
person_module
.
newContent
(
portal_type
=
'Person'
,
person
=
self
.
portal
.
person_module
.
newContent
(
portal_type
=
'Person'
,
reference
=
reference
)
reference
=
reference
)
password
=
person
.
Person_generatePassword
()
self
.
tic
()
self
.
tic
()
...
...
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudSecurityGroup.xml
View file @
85e411bf
...
@@ -100,11 +100,13 @@
...
@@ -100,11 +100,13 @@
</record>
</record>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<pickle>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
patches.WorkflowTool
"
/>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
Workflow
"
/>
</pickle>
</pickle>
<pickle>
<pickle>
<tuple>
<dictionary>
<none/>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<list>
<dictionary>
<dictionary>
<item>
<item>
...
@@ -117,7 +119,9 @@
...
@@ -117,7 +119,9 @@
</item>
</item>
</dictionary>
</dictionary>
</list>
</list>
</tuple>
</value>
</item>
</dictionary>
</pickle>
</pickle>
</record>
</record>
</ZopeData>
</ZopeData>
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSAuthenticationPolicy.py
View file @
85e411bf
...
@@ -84,7 +84,7 @@ class TestSlapOSAuthenticationPolicyL(SlapOSTestCaseMixin):
...
@@ -84,7 +84,7 @@ class TestSlapOSAuthenticationPolicyL(SlapOSTestCaseMixin):
self
.
assertFalse
(
login
.
isLoginBlocked
())
self
.
assertFalse
(
login
.
isLoginBlocked
())
# Password should be ignored
# Password should be ignored
login
.
setPassword
(
"%s-aA$1"
%
self
.
generateNewI
d
())
login
.
setPassword
(
document
.
Person_generatePasswor
d
())
self
.
_clearCache
()
self
.
_clearCache
()
self
.
tic
()
self
.
tic
()
...
@@ -197,7 +197,7 @@ class TestSlapOSAuthenticationPolicyL(SlapOSTestCaseMixin):
...
@@ -197,7 +197,7 @@ class TestSlapOSAuthenticationPolicyL(SlapOSTestCaseMixin):
login_portal_type
=
login_portal_type
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
.
system_preference
.
setPreferredMaxPasswordLifetimeDuration
(
0
)
self
.
_clearCache
()
self
.
_clearCache
()
self
.
assertTrue
(
login
.
isPasswordExpired
())
self
.
assertTrue
(
login
.
isPasswordExpired
())
...
@@ -208,7 +208,7 @@ class TestSlapOSAuthenticationPolicyL(SlapOSTestCaseMixin):
...
@@ -208,7 +208,7 @@ class TestSlapOSAuthenticationPolicyL(SlapOSTestCaseMixin):
login_portal_type
=
login_portal_type
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
.
system_preference
.
setPreferredMaxPasswordLifetimeDuration
(
0
)
self
.
_clearCache
()
self
.
_clearCache
()
self
.
assertFalse
(
login
.
isPasswordExpired
())
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