Commit f2725631 authored by Arnaud Fontaine's avatar Arnaud Fontaine

ZODB Components: erp5_calendar: Migrate Documents and Test from filesystem.

parent 224ee9a7
......@@ -31,25 +31,25 @@ from Products.ERP5Type import Permissions, PropertySheet
from Products.ERP5.Document.Delivery import Delivery
class Calendar(Delivery):
"""
Calendar contains Calendar Lines.
"""
# CMF Type Definition
meta_type = 'ERP5 Calendar'
portal_type = 'Calendar'
"""
Calendar contains Calendar Lines.
"""
# CMF Type Definition
meta_type = 'ERP5 Calendar'
portal_type = 'Calendar'
# Declarative security
security = ClassSecurityInfo()
security.declareObjectProtected(Permissions.AccessContentsInformation)
# Declarative security
security = ClassSecurityInfo()
security.declareObjectProtected(Permissions.AccessContentsInformation)
# Default Properties
property_sheets = ( PropertySheet.Base
, PropertySheet.XMLObject
, PropertySheet.CategoryCore
, PropertySheet.DublinCore
, PropertySheet.Task
, PropertySheet.Arrow
, PropertySheet.Movement
, PropertySheet.Delivery
, PropertySheet.Path
)
# Default Properties
property_sheets = ( PropertySheet.Base
, PropertySheet.XMLObject
, PropertySheet.CategoryCore
, PropertySheet.DublinCore
, PropertySheet.Task
, PropertySheet.Arrow
, PropertySheet.Movement
, PropertySheet.Delivery
, PropertySheet.Path
)
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Document Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>default_reference</string> </key>
<value> <string>Calendar</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5.Document.Calendar</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>document.erp5.Calendar</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Document 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>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Document Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>default_reference</string> </key>
<value> <string>CalendarException</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5.Document.CalendarException</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>document.erp5.CalendarException</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Document 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>
......@@ -28,7 +28,7 @@
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions
from Products.ERP5Type.Accessor.Constant import PropertyGetter as ConstantGetter
from Products.ERP5.Document.PresencePeriod import PresencePeriod
from erp5.component.document.PresencePeriod import PresencePeriod
class GroupCalendarAssignment(PresencePeriod):
# CMF Type Definition
......
......@@ -30,7 +30,7 @@
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet
from Products.ERP5.Document.PresencePeriod import PresencePeriod
from erp5.component.document.PresencePeriod import PresencePeriod
class LeavePeriod(PresencePeriod):
"""
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Document Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>default_reference</string> </key>
<value> <string>LeavePeriod</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5.Document.LeavePeriod</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>document.erp5.LeavePeriod</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Document 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>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Document Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>default_reference</string> </key>
<value> <string>PresencePeriod</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5.Document.PresencePeriod</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>document.erp5.PresencePeriod</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Document 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>
......@@ -30,7 +30,6 @@ import unittest
from unittest import skip
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5ReportTestCase
from AccessControl.SecurityManagement import newSecurityManager
from Products.ERP5Type.tests.Sequence import SequenceList
from DateTime import DateTime
......@@ -62,7 +61,7 @@ class TestCalendar(ERP5ReportTestCase):
cal_type_category_list = ['type1', 'type2', 'type3']
if len(self.category_tool.calendar_period_type.contentValues()) == 0 :
for category_id in cal_type_category_list:
o = self.category_tool.calendar_period_type.newContent(
self.category_tool.calendar_period_type.newContent(
portal_type='Category',
id=category_id)
......@@ -175,13 +174,6 @@ class TestCalendar(ERP5ReportTestCase):
group_presence_period=group_presence_period,
)
def stepSetGroupPresencePeriodValues(self, sequence=None,
sequence_list=None, **kw):
"""
Set values on personal calendar period
"""
group_presence_period = sequence.get('group_presence_period')
def stepSetGroupPresencePeriodDates(self, sequence=None,
sequence_list=None, **kw):
"""
......@@ -288,13 +280,6 @@ class TestCalendar(ERP5ReportTestCase):
personal_leave_period = sequence.get('personal_leave_period')
sequence.edit(obj_to_check=personal_leave_period)
def stepSetPersonalLeavePeriodValues(self, sequence=None,
sequence_list=None, **kw):
"""
Set values on personal calendar event
"""
personal_leave_period = sequence.get('personal_leave_period')
def stepSetPersonalLeavePeriodDates(self, sequence=None,
sequence_list=None, **kw):
"""
......@@ -429,13 +414,6 @@ class TestCalendar(ERP5ReportTestCase):
personal_presence_period = sequence.get('personal_presence_period')
sequence.edit(obj_to_check=personal_presence_period)
def stepSetPersonalPresencePeriodValues(self, sequence=None,
sequence_list=None, **kw):
"""
Set values on personal calendar event
"""
personal_presence_period = sequence.get('personal_presence_period')
def stepSetPersonalPresencePeriodDates(self, sequence=None,
sequence_list=None, **kw):
"""
......@@ -485,7 +463,6 @@ class TestCalendar(ERP5ReportTestCase):
CreateGroupCalendar \
SetGroupCalendarAssignment \
CreateGroupPresencePeriod \
SetGroupPresencePeriodValues \
Tic \
SetGroupCalendarAssignmentToCheck \
CheckNotCatalogued \
......@@ -512,7 +489,6 @@ class TestCalendar(ERP5ReportTestCase):
CreateLeaveRequest \
SetLeaveRequestDestination \
CreatePersonalLeavePeriod \
SetPersonalLeavePeriodValues \
Tic \
SetPersonalLeavePeriodToCheck \
CheckNotCatalogued \
......@@ -540,7 +516,6 @@ class TestCalendar(ERP5ReportTestCase):
CreateLeaveRequest
SetLeaveRequestDestination
CreatePersonalLeavePeriod
SetPersonalLeavePeriodValues
Tic
SetPersonalLeavePeriodToCheck
CheckNotCatalogued
......@@ -686,7 +661,6 @@ class TestCalendar(ERP5ReportTestCase):
CreateGroupCalendar \
SetGroupCalendarAssignment \
CreateGroupPresencePeriod \
SetGroupPresencePeriodValues \
Tic \
SetGroupCalendarAssignmentToCheck \
SetGroupPresencePeriodDates \
......@@ -705,7 +679,6 @@ class TestCalendar(ERP5ReportTestCase):
CreateGroupCalendar \
SetGroupCalendarAssignment \
CreateGroupPresencePeriod \
SetGroupPresencePeriodValues \
Tic \
SetGroupCalendarAssignmentToCheck \
SetGroupPresencePeriodDates \
......@@ -725,7 +698,6 @@ class TestCalendar(ERP5ReportTestCase):
CreateGroupCalendar \
SetGroupCalendarAssignment \
CreateGroupPresencePeriod \
SetGroupPresencePeriodValues \
Tic \
SetGroupCalendarAssignmentToCheck \
PlanGroupCalendar \
......@@ -745,7 +717,6 @@ class TestCalendar(ERP5ReportTestCase):
CreateLeaveRequest \
SetLeaveRequestDestination \
CreatePersonalLeavePeriod \
SetPersonalLeavePeriodValues \
Tic \
SetPersonalLeavePeriodToCheck \
PlanLeaveRequest \
......@@ -765,7 +736,6 @@ class TestCalendar(ERP5ReportTestCase):
CreateGroupCalendar \
SetGroupCalendarAssignment \
CreateGroupPresencePeriod \
SetGroupPresencePeriodValues \
Tic \
SetGroupCalendarAssignmentToCheck \
SetGroupPresencePeriodDates \
......@@ -778,7 +748,6 @@ class TestCalendar(ERP5ReportTestCase):
CreateLeaveRequest \
SetLeaveRequestDestination \
CreatePersonalLeavePeriod \
SetPersonalLeavePeriodValues \
Tic \
PlanLeaveRequest \
ConfirmLeaveRequest \
......@@ -790,13 +759,11 @@ class TestCalendar(ERP5ReportTestCase):
sequence_list.play(self)
@skip("Not Implemented")
def test_04_getCapacityAvailability(self):
"""
Test getCapacityAvailability
"""
return # XXX this test is disabled
raise NotImplementedError
# Test that calendar group increase time availability
sequence_list = SequenceList()
sequence_string = '\
......@@ -804,7 +771,6 @@ class TestCalendar(ERP5ReportTestCase):
CreateGroupCalendar \
SetGroupCalendarAssignment \
CreateGroupPresencePeriod \
SetGroupPresencePeriodValues \
Tic \
SetGroupCalendarAssignmentToCheck \
ConfirmGroupCalendar \
......@@ -823,7 +789,6 @@ class TestCalendar(ERP5ReportTestCase):
CreateGroupCalendar \
SetGroupCalendarAssignment \
CreateGroupPresencePeriod \
SetGroupPresencePeriodValues \
Tic \
SetGroupCalendarAssignmentToCheck \
ConfirmGroupCalendar \
......@@ -843,7 +808,6 @@ class TestCalendar(ERP5ReportTestCase):
CreateGroupCalendar \
SetGroupCalendarAssignment \
CreateGroupPresencePeriod \
SetGroupPresencePeriodValues \
Tic \
SetGroupCalendarAssignmentToCheck \
ConfirmGroupCalendar \
......@@ -2116,7 +2080,6 @@ class TestCalendar(ERP5ReportTestCase):
my_default_leave_request_period_stop_date = LeaveRequest_view.\
my_default_leave_request_period_stop_date
my_start_date = LeaveRequest_view.my_start_date
my_stop_date = LeaveRequest_view.my_stop_date
listbox = LeaveRequest_view.listbox
checkDisplayedAsSimple()
self.assertEqual(
......@@ -2210,7 +2173,7 @@ class TestCalendar(ERP5ReportTestCase):
my_default_presence_request_period_stop_date = PresenceRequest_view.\
my_default_presence_request_period_stop_date
my_start_date = PresenceRequest_view.my_start_date
my_stop_date = PresenceRequest_view.my_stop_date
listbox = PresenceRequest_view.listbox
checkDisplayedAsSimple()
self.assertEqual(
......
<?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>testCalendar</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5.tests.testCalendar</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>test.erp5.testCalendar</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>
document.erp5.GroupCalendarAssignment
\ No newline at end of file
document.erp5.Calendar
document.erp5.CalendarException
document.erp5.GroupCalendarAssignment
document.erp5.LeavePeriod
document.erp5.PresencePeriod
\ No newline at end of file
test.erp5.testCalendar
\ No newline at end of file
erp5_full_text_myisam_catalog
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment