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
Léo-Paul Géneau
erp5
Commits
65dc1a66
Commit
65dc1a66
authored
Apr 08, 2014
by
Sebastien Robin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testCalendar: partially update test to take into account group assignments
parent
24c836a7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
31 deletions
+41
-31
product/ERP5/tests/testCalendar.py
product/ERP5/tests/testCalendar.py
+41
-31
No files found.
product/ERP5/tests/testCalendar.py
View file @
65dc1a66
...
@@ -40,7 +40,7 @@ class TestCalendar(ERP5ReportTestCase):
...
@@ -40,7 +40,7 @@ class TestCalendar(ERP5ReportTestCase):
leave_request_portal_type
=
"Leave Request"
leave_request_portal_type
=
"Leave Request"
group_presence_period_portal_type
=
"Group Presence Period"
group_presence_period_portal_type
=
"Group Presence Period"
leave_request_period_portal_type
=
"Leave Request Period"
leave_request_period_portal_type
=
"Leave Request Period"
start_date
=
DateTime
()
start_date
=
DateTime
(
DateTime
().
ISO8601
()
)
stop_date
=
start_date
+
0.5
stop_date
=
start_date
+
0.5
middle_date
=
start_date
+
0.25
middle_date
=
start_date
+
0.25
periodicity_stop_date
=
start_date
+
2
periodicity_stop_date
=
start_date
+
2
...
@@ -51,7 +51,7 @@ class TestCalendar(ERP5ReportTestCase):
...
@@ -51,7 +51,7 @@ class TestCalendar(ERP5ReportTestCase):
def
getBusinessTemplateList
(
self
):
def
getBusinessTemplateList
(
self
):
"""
"""
"""
"""
return
(
'erp5_base'
,
'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
):
def
login
(
self
,
quiet
=
0
,
run
=
run_all_test
):
uf
=
self
.
getPortal
().
acl_users
uf
=
self
.
getPortal
().
acl_users
...
@@ -76,6 +76,14 @@ class TestCalendar(ERP5ReportTestCase):
...
@@ -76,6 +76,14 @@ class TestCalendar(ERP5ReportTestCase):
self
.
category_tool
.
group
.
newContent
(
portal_type
=
'Category'
,
self
.
category_tool
.
group
.
newContent
(
portal_type
=
'Category'
,
id
=
'my_group'
)
id
=
'my_group'
)
def
createService
(
self
):
"""
Create service that will be used to fill stock
"""
module
=
self
.
portal
.
service_module
if
getattr
(
module
,
'consulting_service'
,
None
)
is
None
:
module
.
newContent
(
id
=
'consulting_service'
,
title
=
'Consulting Service'
)
def
afterSetUp
(
self
):
def
afterSetUp
(
self
):
"""
"""
...
@@ -83,6 +91,7 @@ class TestCalendar(ERP5ReportTestCase):
...
@@ -83,6 +91,7 @@ class TestCalendar(ERP5ReportTestCase):
"""
"""
self
.
category_tool
=
self
.
getCategoryTool
()
self
.
category_tool
=
self
.
getCategoryTool
()
self
.
createCategories
()
self
.
createCategories
()
self
.
createService
()
# activate constraints
# activate constraints
self
.
_addPropertySheet
(
'Group Calendar'
,
'CalendarConstraint'
)
self
.
_addPropertySheet
(
'Group Calendar'
,
'CalendarConstraint'
)
self
.
_addPropertySheet
(
'Presence Request'
,
'CalendarConstraint'
)
self
.
_addPropertySheet
(
'Presence Request'
,
'CalendarConstraint'
)
...
@@ -142,22 +151,21 @@ class TestCalendar(ERP5ReportTestCase):
...
@@ -142,22 +151,21 @@ class TestCalendar(ERP5ReportTestCase):
group_calendar
=
pc
,
group_calendar
=
pc
,
)
)
def
stepSetGroupCalendar
Source
(
self
,
sequence
=
None
,
def
stepSetGroupCalendar
Assignment
(
self
,
sequence
=
None
,
sequence_list
=
None
,
**
kw
):
sequence_list
=
None
,
**
kw
):
"""
"""
Set the source
Set the source
"""
"""
group_calendar
=
sequence
.
get
(
'group_calendar'
)
group_calendar
=
sequence
.
get
(
'group_calendar'
)
person
=
sequence
.
get
(
'person'
)
person
=
sequence
.
get
(
'person'
)
assignment_list
=
person
.
contentValues
(
portal_type
=
'Assignment'
)
assignment
=
self
.
portal
.
group_calendar_assignment_module
.
newContent
(
if
len
(
assignment_list
)
!=
0
:
destination_value
=
person
,
assignment
=
assignment_list
[
0
]
resource_value
=
self
.
portal
.
service_module
.
consulting_service
,
else
:
start_date
=
self
.
start_date
,
assignment
=
person
.
newContent
(
stop_date
=
self
.
stop_date
,
portal_type
=
'Assignment'
,
specialise_value
=
group_calendar
)
)
assignment
.
confirm
()
assignment
.
setCalendarList
(
sequence
.
edit
(
assignment
=
assignment
)
assignment
.
getCalendarList
()
+
[
group_calendar
.
getRelativeUrl
()])
def
stepCreateGroupPresencePeriod
(
self
,
sequence
=
None
,
def
stepCreateGroupPresencePeriod
(
self
,
sequence
=
None
,
sequence_list
=
None
,
**
kw
):
sequence_list
=
None
,
**
kw
):
...
@@ -190,6 +198,8 @@ class TestCalendar(ERP5ReportTestCase):
...
@@ -190,6 +198,8 @@ class TestCalendar(ERP5ReportTestCase):
start_date
=
self
.
start_date
,
start_date
=
self
.
start_date
,
stop_date
=
self
.
stop_date
,
stop_date
=
self
.
stop_date
,
)
)
# XXX(Seb), replace by interaction workflow
#sequence.get("assignment").reindexObject()
def
stepSetGroupPresencePeriodPerStopDate
(
self
,
sequence
=
None
,
def
stepSetGroupPresencePeriodPerStopDate
(
self
,
sequence
=
None
,
sequence_list
=
None
,
**
kw
):
sequence_list
=
None
,
**
kw
):
...
@@ -201,13 +211,13 @@ class TestCalendar(ERP5ReportTestCase):
...
@@ -201,13 +211,13 @@ class TestCalendar(ERP5ReportTestCase):
periodicity_stop_date
=
self
.
periodicity_stop_date
,
periodicity_stop_date
=
self
.
periodicity_stop_date
,
)
)
def
stepSetGroup
PresencePeriod
ToCheck
(
self
,
sequence
=
None
,
def
stepSetGroup
CalendarAssignment
ToCheck
(
self
,
sequence
=
None
,
sequence_list
=
None
,
**
kw
):
sequence_list
=
None
,
**
kw
):
"""
"""
Set personal calendar period to check
Set personal calendar period to check
"""
"""
group_presence_period
=
sequence
.
get
(
'group_presence_period
'
)
assignment
=
sequence
.
get
(
'assignment
'
)
sequence
.
edit
(
obj_to_check
=
group_presence_period
)
sequence
.
edit
(
obj_to_check
=
assignment
)
def
stepSetGroupCalendarEventPerStopDate
(
self
,
sequence
=
None
,
def
stepSetGroupCalendarEventPerStopDate
(
self
,
sequence
=
None
,
sequence_list
=
None
,
**
kw
):
sequence_list
=
None
,
**
kw
):
...
@@ -392,11 +402,11 @@ class TestCalendar(ERP5ReportTestCase):
...
@@ -392,11 +402,11 @@ class TestCalendar(ERP5ReportTestCase):
sequence_string
=
'
\
sequence_string
=
'
\
CreatePerson
\
CreatePerson
\
CreateGroupCalendar
\
CreateGroupCalendar
\
SetGroupCalendar
Source
\
SetGroupCalendar
Assignment
\
CreateGroupPresencePeriod
\
CreateGroupPresencePeriod
\
SetGroupPresencePeriodValues
\
SetGroupPresencePeriodValues
\
Tic
\
Tic
\
SetGroup
PresencePeriod
ToCheck
\
SetGroup
CalendarAssignment
ToCheck
\
CheckNotCatalogued
\
CheckNotCatalogued
\
ConfirmGroupCalendar
\
ConfirmGroupCalendar
\
Tic
\
Tic
\
...
@@ -572,11 +582,11 @@ class TestCalendar(ERP5ReportTestCase):
...
@@ -572,11 +582,11 @@ class TestCalendar(ERP5ReportTestCase):
sequence_string
=
'
\
sequence_string
=
'
\
CreatePerson
\
CreatePerson
\
CreateGroupCalendar
\
CreateGroupCalendar
\
SetGroupCalendar
Source
\
SetGroupCalendar
Assignment
\
CreateGroupPresencePeriod
\
CreateGroupPresencePeriod
\
SetGroupPresencePeriodValues
\
SetGroupPresencePeriodValues
\
Tic
\
Tic
\
SetGroup
PresencePeriod
ToCheck
\
SetGroup
CalendarAssignment
ToCheck
\
SetGroupPresencePeriodDates
\
SetGroupPresencePeriodDates
\
SetGroupPresencePeriodPerStopDate
\
SetGroupPresencePeriodPerStopDate
\
ConfirmActionGroupCalendar
\
ConfirmActionGroupCalendar
\
...
@@ -591,11 +601,11 @@ class TestCalendar(ERP5ReportTestCase):
...
@@ -591,11 +601,11 @@ class TestCalendar(ERP5ReportTestCase):
sequence_string
=
'
\
sequence_string
=
'
\
CreatePerson
\
CreatePerson
\
CreateGroupCalendar
\
CreateGroupCalendar
\
SetGroupCalendar
Source
\
SetGroupCalendar
Assignment
\
CreateGroupPresencePeriod
\
CreateGroupPresencePeriod
\
SetGroupPresencePeriodValues
\
SetGroupPresencePeriodValues
\
Tic
\
Tic
\
SetGroup
PresencePeriod
ToCheck
\
SetGroup
CalendarAssignment
ToCheck
\
SetGroupPresencePeriodDates
\
SetGroupPresencePeriodDates
\
SetGroupPresencePeriodPerStopDate
\
SetGroupPresencePeriodPerStopDate
\
ConfirmActionGroupCalendar
\
ConfirmActionGroupCalendar
\
...
@@ -611,11 +621,11 @@ class TestCalendar(ERP5ReportTestCase):
...
@@ -611,11 +621,11 @@ class TestCalendar(ERP5ReportTestCase):
sequence_string
=
'
\
sequence_string
=
'
\
GetLastCreatedPerson
\
GetLastCreatedPerson
\
CreateGroupCalendar
\
CreateGroupCalendar
\
SetGroupCalendar
Source
\
SetGroupCalendar
Assignment
\
CreateGroupPresencePeriod
\
CreateGroupPresencePeriod
\
SetGroupPresencePeriodValues
\
SetGroupPresencePeriodValues
\
Tic
\
Tic
\
SetGroup
PresencePeriod
ToCheck
\
SetGroup
CalendarAssignment
ToCheck
\
PlanGroupCalendar
\
PlanGroupCalendar
\
SetGroupPresencePeriodDates
\
SetGroupPresencePeriodDates
\
SetGroupPresencePeriodPerStopDate
\
SetGroupPresencePeriodPerStopDate
\
...
@@ -651,11 +661,11 @@ class TestCalendar(ERP5ReportTestCase):
...
@@ -651,11 +661,11 @@ class TestCalendar(ERP5ReportTestCase):
sequence_string
=
'
\
sequence_string
=
'
\
CreatePerson
\
CreatePerson
\
CreateGroupCalendar
\
CreateGroupCalendar
\
SetGroupCalendar
Source
\
SetGroupCalendar
Assignment
\
CreateGroupPresencePeriod
\
CreateGroupPresencePeriod
\
SetGroupPresencePeriodValues
\
SetGroupPresencePeriodValues
\
Tic
\
Tic
\
SetGroup
PresencePeriod
ToCheck
\
SetGroup
CalendarAssignment
ToCheck
\
SetGroupPresencePeriodDates
\
SetGroupPresencePeriodDates
\
SetGroupPresencePeriodPerStopDate
\
SetGroupPresencePeriodPerStopDate
\
ConfirmActionGroupCalendar
\
ConfirmActionGroupCalendar
\
...
@@ -690,11 +700,11 @@ class TestCalendar(ERP5ReportTestCase):
...
@@ -690,11 +700,11 @@ class TestCalendar(ERP5ReportTestCase):
sequence_string
=
'
\
sequence_string
=
'
\
CreatePerson
\
CreatePerson
\
CreateGroupCalendar
\
CreateGroupCalendar
\
SetGroupCalendar
Source
\
SetGroupCalendar
Assignment
\
CreateGroupPresencePeriod
\
CreateGroupPresencePeriod
\
SetGroupPresencePeriodValues
\
SetGroupPresencePeriodValues
\
Tic
\
Tic
\
SetGroup
PresencePeriod
ToCheck
\
SetGroup
CalendarAssignment
ToCheck
\
ConfirmGroupCalendar
\
ConfirmGroupCalendar
\
SetGroupPresencePeriodDates
\
SetGroupPresencePeriodDates
\
SetGroupPresencePeriodPerStopDate
\
SetGroupPresencePeriodPerStopDate
\
...
@@ -709,11 +719,11 @@ class TestCalendar(ERP5ReportTestCase):
...
@@ -709,11 +719,11 @@ class TestCalendar(ERP5ReportTestCase):
sequence_string
=
'
\
sequence_string
=
'
\
CreatePerson
\
CreatePerson
\
CreateGroupCalendar
\
CreateGroupCalendar
\
SetGroupCalendar
Source
\
SetGroupCalendar
Assignment
\
CreateGroupPresencePeriod
\
CreateGroupPresencePeriod
\
SetGroupPresencePeriodValues
\
SetGroupPresencePeriodValues
\
Tic
\
Tic
\
SetGroup
PresencePeriod
ToCheck
\
SetGroup
CalendarAssignment
ToCheck
\
ConfirmGroupCalendar
\
ConfirmGroupCalendar
\
SetGroupPresencePeriodDates
\
SetGroupPresencePeriodDates
\
SetGroupPresencePeriodPerStopDate
\
SetGroupPresencePeriodPerStopDate
\
...
@@ -729,11 +739,11 @@ class TestCalendar(ERP5ReportTestCase):
...
@@ -729,11 +739,11 @@ class TestCalendar(ERP5ReportTestCase):
sequence_string
=
'
\
sequence_string
=
'
\
GetLastCreatedPerson
\
GetLastCreatedPerson
\
CreateGroupCalendar
\
CreateGroupCalendar
\
SetGroupCalendar
Source
\
SetGroupCalendar
Assignment
\
CreateGroupPresencePeriod
\
CreateGroupPresencePeriod
\
SetGroupPresencePeriodValues
\
SetGroupPresencePeriodValues
\
Tic
\
Tic
\
SetGroup
PresencePeriod
ToCheck
\
SetGroup
CalendarAssignment
ToCheck
\
ConfirmGroupCalendar
\
ConfirmGroupCalendar
\
SetGroupPresencePeriodDates
\
SetGroupPresencePeriodDates
\
SetGroupPresencePeriodPerStopDate
\
SetGroupPresencePeriodPerStopDate
\
...
...
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