Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
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
Sebastien Robin
erp5
Commits
62f832b4
Commit
62f832b4
authored
Sep 02, 2020
by
Arnaud Fontaine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ZODB Components: erp5_authentication_policy: Migrate Unit Test.
parent
5dc3a8b0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
118 additions
and
7 deletions
+118
-7
bt5/erp5_authentication_policy/TestTemplateItem/portal_components/test.erp5.testAuthenticationPolicy.py
...m/portal_components/test.erp5.testAuthenticationPolicy.py
+2
-7
bt5/erp5_authentication_policy/TestTemplateItem/portal_components/test.erp5.testAuthenticationPolicy.xml
.../portal_components/test.erp5.testAuthenticationPolicy.xml
+110
-0
bt5/erp5_authentication_policy/bt/template_test_id_list
bt5/erp5_authentication_policy/bt/template_test_id_list
+1
-0
bt5/erp5_authentication_policy/bt/test_dependency_list
bt5/erp5_authentication_policy/bt/test_dependency_list
+5
-0
No files found.
product/ERP5/tests/
testAuthenticationPolicy.py
→
bt5/erp5_authentication_policy/TestTemplateItem/portal_components/test.erp5.
testAuthenticationPolicy.py
View file @
62f832b4
...
...
@@ -35,7 +35,6 @@ from StringIO import StringIO
import
time
import
httplib
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
Products.Formulator.Errors
import
ValidationError
from
Products.ERP5Type.Document
import
newTempBase
class
TestAuthenticationPolicy
(
ERP5TypeTestCase
):
...
...
@@ -125,7 +124,6 @@ class TestAuthenticationPolicy(ERP5TypeTestCase):
"""
if
person_kw
is
None
:
person_kw
=
{}
self
.
createUser
person
=
self
.
portal
.
person_module
.
newContent
(
portal_type
=
'Person'
,
**
person_kw
)
login
=
person
.
newContent
(
portal_type
=
'ERP5 Login'
,
...
...
@@ -284,7 +282,6 @@ class TestAuthenticationPolicy(ERP5TypeTestCase):
Test validity of a password.
"""
portal
=
self
.
getPortal
()
request
=
self
.
app
.
REQUEST
regular_expression_list
=
[
'([a-z]+)'
,
# english lowercase
'([A-Z]+)'
,
# english uppercase
...
...
@@ -607,7 +604,6 @@ class TestAuthenticationPolicy(ERP5TypeTestCase):
Test automatic system recover password
"""
portal
=
self
.
portal
request
=
self
.
app
.
REQUEST
self
.
assertTrue
(
portal
.
portal_preferences
.
isAuthenticationPolicyEnabled
())
preference
=
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
'System Preference'
,
...
...
@@ -635,7 +631,7 @@ class TestAuthenticationPolicy(ERP5TypeTestCase):
)
# User cannot login
# fire 5 requests, only 1 credential recovery should be created
for
i
in
range
(
5
):
for
_
in
range
(
5
):
response
=
publish
()
self
.
assertTrue
(
response
.
getHeader
(
"Location"
).
endswith
(
"login_form"
))
self
.
tic
()
...
...
@@ -663,7 +659,6 @@ class TestAuthenticationPolicy(ERP5TypeTestCase):
Check HTTP responses
"""
portal
=
self
.
getPortal
()
request
=
self
.
app
.
REQUEST
preference
=
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
'System Preference'
,
title
=
'Authentication'
,)
...
...
@@ -786,7 +781,7 @@ class TestAuthenticationPolicy(ERP5TypeTestCase):
password
=
'current'
,
person_kw
=
{
'first_name'
:
'Alice'
})
person
.
newContent
(
portal_type
=
'Assignment'
).
open
()
login
=
person
.
objectValues
(
portal_type
=
'ERP5 Login'
)[
0
]
self
.
assertEqual
(
len
(
person
.
objectValues
(
portal_type
=
'ERP5 Login'
)),
1
)
preference
=
self
.
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
'System Preference'
,
title
=
'Authentication'
,)
...
...
bt5/erp5_authentication_policy/TestTemplateItem/portal_components/test.erp5.testAuthenticationPolicy.xml
0 → 100644
View file @
62f832b4
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Test Component"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
testAuthenticationPolicy
</string>
</value>
</item>
<item>
<key>
<string>
default_source_reference
</string>
</key>
<value>
<string>
Products.ERP5.tests.testAuthenticationPolicy
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
test.erp5.testAuthenticationPolicy
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Test Component
</string>
</value>
</item>
<item>
<key>
<string>
sid
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
text_content_error_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
erp5
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</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>
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
<pickle>
<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>
bt5/erp5_authentication_policy/bt/template_test_id_list
0 → 100644
View file @
62f832b4
test.erp5.testAuthenticationPolicy
\ No newline at end of file
bt5/erp5_authentication_policy/bt/test_dependency_list
0 → 100644
View file @
62f832b4
erp5_full_text_mroonga_catalog
erp5_core_proxy_field_legacy
erp5_base
erp5_web
erp5_crm
\ No newline at end of file
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