Commit ff1f8b81 authored by Nicolas Wavrant's avatar Nicolas Wavrant

erp5_interface_post: update tests

parent cc07a119
...@@ -112,7 +112,7 @@ class TestInterfacePost(ERP5TypeTestCase): ...@@ -112,7 +112,7 @@ class TestInterfacePost(ERP5TypeTestCase):
self.portal.portal_skins.custom, self.portal.portal_skins.custom,
"LetterPost_export", "LetterPost_export",
"", "",
"if context.getSimulationState() == 'exportable':\n context.export()", "context.export()",
) )
def _stepCreateEvent(self, portal_type, sequence=None, sequence_list=None): def _stepCreateEvent(self, portal_type, sequence=None, sequence_list=None):
...@@ -164,16 +164,16 @@ class TestInterfacePost(ERP5TypeTestCase): ...@@ -164,16 +164,16 @@ class TestInterfacePost(ERP5TypeTestCase):
'start_action' 'start_action'
) )
def _allowExportOfAllPostByPortalType(self, portal_type): def _prepareExportOfAllPostByPortalType(self, portal_type):
result_list = self._portal_catalog(portal_type=portal_type) result_list = self._portal_catalog(portal_type=portal_type)
for result in result_list: for result in result_list:
result.allowExport() result.prepareExport()
def stepAllowExportOfAllInternetMessagePost(self, sequence=None, sequence_list=None): def stepPrepareExportOfAllInternetMessagePost(self, sequence=None, sequence_list=None):
self._allowExportOfAllPostByPortalType('Internet Message Post') self._prepareExportOfAllPostByPortalType('Internet Message Post')
def stepAllowExportOfAllLetterPost(self, sequence=None, sequence_list=None): def stepPrepareExportOfAllLetterPost(self, sequence=None, sequence_list=None):
self._allowExportOfAllPostByPortalType('Letter Post') self._prepareExportOfAllPostByPortalType('Letter Post')
def stepChangeMailMessageTextContent(self, sequence=None, sequence_list=None): def stepChangeMailMessageTextContent(self, sequence=None, sequence_list=None):
mail_message = sequence['mail_message'] mail_message = sequence['mail_message']
...@@ -211,14 +211,13 @@ class TestInterfacePost(ERP5TypeTestCase): ...@@ -211,14 +211,13 @@ class TestInterfacePost(ERP5TypeTestCase):
def stepCheckOnlyOneLetterPostIsExported(self, sequence=None, sequence_list=None): def stepCheckOnlyOneLetterPostIsExported(self, sequence=None, sequence_list=None):
self._checkOnlyOnePostIsExportedByPortalType('Letter Post') self._checkOnlyOnePostIsExportedByPortalType('Letter Post')
def stepCheckAllLetterPostAreExportable(self, sequence=None, sequence_list=None): def stepCheckAllLetterPostIsExportPrepared(self, sequence=None, sequence_list=None):
letter_post_list = self._portal_catalog( letter_post_list = self._portal_catalog(
portal_type='Letter Post', portal_type='Letter Post',
simulation_state='exportable', simulation_state='export_prepared',
) )
self.assertEqual(len(letter_post_list), len(sequence['letter_list'])) self.assertEqual(len(letter_post_list), len(sequence['letter_list']))
for letter_post in letter_post_list: for letter_post in letter_post_list:
self.assertEqual(letter_post.getSimulationState(), 'exportable')
self.assertTrue(letter_post.hasData()) self.assertTrue(letter_post.hasData())
self.assertEqual(letter_post.getContentType(), 'application/pdf') self.assertEqual(letter_post.getContentType(), 'application/pdf')
self.assertIn( self.assertIn(
...@@ -319,8 +318,9 @@ class TestInterfacePost(ERP5TypeTestCase): ...@@ -319,8 +318,9 @@ class TestInterfacePost(ERP5TypeTestCase):
portal_type='Internet Message Post', portal_type='Internet Message Post',
data=mail_object.as_string(), data=mail_object.as_string(),
) )
response_post.InternetMessagePost_ingest() response_post.prepareImport()
sequence['internet_message_post_response'] = response_post sequence['internet_message_post_response'] = response_post
response_post.log('Nicolas : %s' % response_post.getId())
def stepCheckMailMessageResponseCreated(self, sequence=None, sequence_list=None): def stepCheckMailMessageResponseCreated(self, sequence=None, sequence_list=None):
response_list = self._portal_catalog( response_list = self._portal_catalog(
...@@ -436,7 +436,7 @@ class TestInterfacePost(ERP5TypeTestCase): ...@@ -436,7 +436,7 @@ class TestInterfacePost(ERP5TypeTestCase):
stepCreateLetter stepCreateLetter
stepSendAllLetter stepSendAllLetter
stepTic stepTic
stepCheckAllLetterPostAreExportable stepCheckAllLetterPostIsExportPrepared
stepLaunchExportOnLetterPostModule stepLaunchExportOnLetterPostModule
stepTic stepTic
stepCheckAllLetterPostAreExported stepCheckAllLetterPostAreExported
......
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