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
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
Laurent S
erp5
Commits
5a134b23
Commit
5a134b23
authored
Apr 09, 2018
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
calendar: modernize test
parent
c278aed1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
25 deletions
+7
-25
product/ERP5/tests/testCalendar.py
product/ERP5/tests/testCalendar.py
+7
-25
No files found.
product/ERP5/tests/testCalendar.py
View file @
5a134b23
...
@@ -34,9 +34,9 @@ from AccessControl.SecurityManagement import newSecurityManager
...
@@ -34,9 +34,9 @@ from AccessControl.SecurityManagement import newSecurityManager
from
Products.ERP5Type.tests.Sequence
import
SequenceList
from
Products.ERP5Type.tests.Sequence
import
SequenceList
from
DateTime
import
DateTime
from
DateTime
import
DateTime
class
TestCalendar
(
ERP5ReportTestCase
):
class
TestCalendar
(
ERP5ReportTestCase
):
run_all_test
=
1
person_portal_type
=
"Person"
person_portal_type
=
"Person"
group_calendar_portal_type
=
"Group Calendar"
group_calendar_portal_type
=
"Group Calendar"
leave_request_portal_type
=
"Leave Request"
leave_request_portal_type
=
"Leave Request"
...
@@ -49,21 +49,11 @@ class TestCalendar(ERP5ReportTestCase):
...
@@ -49,21 +49,11 @@ class TestCalendar(ERP5ReportTestCase):
middle_date
=
start_date
+
0.25
middle_date
=
start_date
+
0.25
periodicity_stop_date
=
start_date
+
2
periodicity_stop_date
=
start_date
+
2
def
getTitle
(
self
):
return
"Calendar"
def
getBusinessTemplateList
(
self
):
def
getBusinessTemplateList
(
self
):
"""
"""
"""
"""
return
(
'erp5_base'
,
'erp5_pdm'
,
'erp5_calendar'
,
'erp5_core_proxy_field_legacy'
)
return
(
'erp5_base'
,
'erp5_pdm'
,
'erp5_calendar'
,
'erp5_core_proxy_field_legacy'
)
def
login
(
self
,
quiet
=
0
,
run
=
run_all_test
):
uf
=
self
.
getPortal
().
acl_users
uf
.
_doAddUser
(
'rc'
,
''
,
[
'Manager'
,
'Author'
,
'Assignor'
,
'Assignee'
,
'Auditor'
],
[])
user
=
uf
.
getUserById
(
'rc'
).
__of__
(
uf
)
newSecurityManager
(
None
,
user
)
def
createCategories
(
self
):
def
createCategories
(
self
):
"""
"""
Light install create only base categories, so we create
Light install create only base categories, so we create
...
@@ -485,12 +475,10 @@ class TestCalendar(ERP5ReportTestCase):
...
@@ -485,12 +475,10 @@ class TestCalendar(ERP5ReportTestCase):
presence_request
.
confirm
()
presence_request
.
confirm
()
self
.
assertEqual
(
'confirmed'
,
presence_request
.
getSimulationState
())
self
.
assertEqual
(
'confirmed'
,
presence_request
.
getSimulationState
())
def
test_01_CatalogCalendarPeriod
(
self
,
quiet
=
0
,
run
=
run_all_test
):
def
test_01_CatalogCalendarPeriod
(
self
):
"""
"""
Test indexing
Test indexing
"""
"""
if
not
run
:
return
sequence_list
=
SequenceList
()
sequence_list
=
SequenceList
()
sequence_string
=
'
\
sequence_string
=
'
\
CreatePerson
\
CreatePerson
\
...
@@ -514,12 +502,10 @@ class TestCalendar(ERP5ReportTestCase):
...
@@ -514,12 +502,10 @@ class TestCalendar(ERP5ReportTestCase):
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
sequence_list
.
play
(
self
)
def
test_02_CatalogLeaveRequest
(
self
,
quiet
=
0
,
run
=
run_all_test
):
def
test_02_CatalogLeaveRequest
(
self
):
"""
"""
Test indexing
Test indexing
"""
"""
if
not
run
:
return
sequence_list
=
SequenceList
()
sequence_list
=
SequenceList
()
sequence_string
=
'
\
sequence_string
=
'
\
CreatePerson
\
CreatePerson
\
...
@@ -544,12 +530,10 @@ class TestCalendar(ERP5ReportTestCase):
...
@@ -544,12 +530,10 @@ class TestCalendar(ERP5ReportTestCase):
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
sequence_list
.
play
(
self
)
def
test_CatalogPresenceRequest
(
self
,
quiet
=
0
,
run
=
run_all_test
):
def
test_CatalogPresenceRequest
(
self
):
"""
"""
Test indexing
Test indexing
"""
"""
if
not
run
:
return
sequence_list
=
SequenceList
()
sequence_list
=
SequenceList
()
sequence_string
=
'''
sequence_string
=
'''
CreatePerson
CreatePerson
...
@@ -691,12 +675,10 @@ class TestCalendar(ERP5ReportTestCase):
...
@@ -691,12 +675,10 @@ class TestCalendar(ERP5ReportTestCase):
# self.assertEqual(len(date_period_list) * second_availability,
# self.assertEqual(len(date_period_list) * second_availability,
# person.getAvailableTime())
# person.getAvailableTime())
def
test_03_getAvailableTime
(
self
,
quiet
=
0
,
run
=
run_all_test
):
def
test_03_getAvailableTime
(
self
):
"""
"""
Test indexing
Test indexing
"""
"""
if
not
run
:
return
# Test that calendar group increase time availability
# Test that calendar group increase time availability
sequence_list
=
SequenceList
()
sequence_list
=
SequenceList
()
sequence_string
=
'
\
sequence_string
=
'
\
...
@@ -808,11 +790,11 @@ class TestCalendar(ERP5ReportTestCase):
...
@@ -808,11 +790,11 @@ class TestCalendar(ERP5ReportTestCase):
sequence_list
.
play
(
self
)
sequence_list
.
play
(
self
)
def
test_04_getCapacityAvailability
(
self
,
quiet
=
0
,
run
=
0
):
def
test_04_getCapacityAvailability
(
self
):
"""
"""
Test getCapacityAvailability
Test getCapacityAvailability
"""
"""
if
not
run
:
return
return
# XXX this test is disabled
raise
NotImplementedError
raise
NotImplementedError
# Test that calendar group increase time availability
# Test that calendar group increase time availability
...
...
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