Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5-Boxiang
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
Hamza
erp5-Boxiang
Commits
6b83d2b1
Commit
6b83d2b1
authored
Jun 12, 2013
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup test file.
parent
1c84ec2a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
38 deletions
+6
-38
product/ERP5/tests/testPasswordTool.py
product/ERP5/tests/testPasswordTool.py
+6
-38
No files found.
product/ERP5/tests/testPasswordTool.py
View file @
6b83d2b1
...
...
@@ -29,9 +29,7 @@
import
unittest
from
Testing
import
ZopeTestCase
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
zLOG
import
LOG
from
Products.ERP5Type.tests.Sequence
import
SequenceList
from
DateTime
import
DateTime
...
...
@@ -39,16 +37,12 @@ class TestPasswordTool(ERP5TypeTestCase):
"""
Test reset of password
"""
run_all_test
=
1
quiet
=
1
def
getBusinessTemplateList
(
self
):
return
(
'erp5_base'
,
)
def
getTitle
(
self
):
return
"Password Tool"
def
afterSetUp
(
self
):
self
.
portal
.
email_from_address
=
'site@example.invalid'
self
.
portal
.
MailHost
.
reset
()
...
...
@@ -168,7 +162,6 @@ class TestPasswordTool(ERP5TypeTestCase):
self
.
assertEquals
(
'Portal Administrator <site@example.invalid>'
,
mfrom
)
self
.
assertEquals
([
'userA@example.invalid'
],
mto
)
def
stepGoToRandomAddress
(
self
,
sequence
=
None
,
sequence_list
=
None
,
**
kw
):
"""
Call method that change the password
...
...
@@ -183,7 +176,6 @@ class TestPasswordTool(ERP5TypeTestCase):
# reset cache
self
.
portal
.
portal_caches
.
clearAllCache
()
def
stepGoToRandomAddressWithBadUserName
(
self
,
sequence
=
None
,
sequence_list
=
None
,
**
kw
):
"""
Call method that change the password with a bad user name
...
...
@@ -198,7 +190,6 @@ class TestPasswordTool(ERP5TypeTestCase):
# reset cache
self
.
portal
.
portal_caches
.
clearAllCache
()
def
stepGoToRandomAddressTwice
(
self
,
sequence
=
None
,
sequence_list
=
None
,
**
kw
):
"""
As we already change password, this must npot work anylonger
...
...
@@ -211,7 +202,6 @@ class TestPasswordTool(ERP5TypeTestCase):
# reset cache
self
.
portal
.
portal_caches
.
clearAllCache
()
def
stepGoToBadRandomAddress
(
self
,
sequence
=
None
,
sequence_list
=
None
,
**
kw
):
"""
Try to reset a password with bad random part
...
...
@@ -224,7 +214,6 @@ class TestPasswordTool(ERP5TypeTestCase):
self
.
portal
.
portal_caches
.
clearAllCache
()
def
stepModifyExpirationDate
(
self
,
sequence
=
None
,
sequence_list
=
None
,
**
kw
):
"""
Change expiration date so that reset of password is not available
...
...
@@ -250,7 +239,6 @@ class TestPasswordTool(ERP5TypeTestCase):
"""
self
.
assertEqual
(
len
(
self
.
portal
.
portal_password
.
_password_request_dict
),
0
)
def
stepLogout
(
self
,
sequence
=
None
,
sequence_list
=
None
,
**
kw
):
"""
Logout
...
...
@@ -258,12 +246,7 @@ class TestPasswordTool(ERP5TypeTestCase):
self
.
logout
()
# tests
def
test_01_checkPasswordTool
(
self
,
quiet
=
quiet
,
run
=
run_all_test
):
if
not
run
:
return
if
not
quiet
:
message
=
'Test Password Tool'
ZopeTestCase
.
_print
(
'
\
n
%s '
%
message
)
LOG
(
'Testing... '
,
0
,
message
)
def
test_01_checkPasswordTool
(
self
):
sequence_list
=
SequenceList
()
sequence_string
=
'CheckPasswordToolExists '
\
'AddUser Tic '
\
...
...
@@ -282,15 +265,9 @@ class TestPasswordTool(ERP5TypeTestCase):
'CheckUserNotLoginWithFormerPassword '
\
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
,
quiet
=
quiet
)
sequence_list
.
play
(
self
)
def
test_02_checkPasswordToolDateExpired
(
self
,
quiet
=
quiet
,
run
=
run_all_test
):
if
not
run
:
return
if
not
quiet
:
message
=
'Test no login reset if date expired'
ZopeTestCase
.
_print
(
'
\
n
%s '
%
message
)
LOG
(
'Testing... '
,
0
,
message
)
def
test_02_checkPasswordToolDateExpired
(
self
):
sequence_list
=
SequenceList
()
sequence_string
=
'CheckPasswordToolExists '
\
'AddUser Tic '
\
...
...
@@ -303,15 +280,9 @@ class TestPasswordTool(ERP5TypeTestCase):
'CheckUserLogin CheckUserNotLoginWithBadPassword '
\
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
,
quiet
=
quiet
)
sequence_list
.
play
(
self
)
def
test_03_checkPasswordToolAlarm
(
self
,
quiet
=
quiet
,
run
=
run_all_test
):
if
not
run
:
return
if
not
quiet
:
message
=
'Test alarm remove expired request'
ZopeTestCase
.
_print
(
'
\
n
%s '
%
message
)
LOG
(
'Testing... '
,
0
,
message
)
def
test_03_checkPasswordToolAlarm
(
self
):
sequence_list
=
SequenceList
()
sequence_string
=
'CheckPasswordToolExists '
\
'AddUser Tic '
\
...
...
@@ -326,7 +297,7 @@ class TestPasswordTool(ERP5TypeTestCase):
'CheckUserLogin CheckUserNotLoginWithBadPassword '
\
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
,
quiet
=
quiet
)
sequence_list
.
play
(
self
)
def
test_two_concurrent_password_reset
(
self
):
personA
=
self
.
portal
.
person_module
.
newContent
(
portal_type
=
"Person"
,
...
...
@@ -381,7 +352,6 @@ class TestPasswordTool(ERP5TypeTestCase):
self
.
_assertUserExists
(
'userA'
,
'newA'
)
self
.
_assertUserExists
(
'userB'
,
'newB'
)
def
test_login_with_trailing_space
(
self
):
person
=
self
.
portal
.
person_module
.
newContent
(
portal_type
=
"Person"
,
reference
=
"userZ "
,
...
...
@@ -455,7 +425,6 @@ class TestPasswordTool(ERP5TypeTestCase):
self
.
assertTrue
(
"portal_status_message=User+user+does+not+have+an+email+"
\
"address%2C+please+contact+site+administrator+directly"
in
str
(
ret
))
class
TestPasswordToolWithCRM
(
TestPasswordTool
):
"""
Test reset of password
...
...
@@ -467,7 +436,6 @@ class TestPasswordToolWithCRM(TestPasswordTool):
def
getTitle
(
self
):
return
"Password Tool with CRM"
def
test_suite
():
suite
=
unittest
.
TestSuite
()
suite
.
addTest
(
unittest
.
makeSuite
(
TestPasswordTool
))
...
...
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