Commit ff1f8b81 authored by Nicolas Wavrant's avatar Nicolas Wavrant

erp5_interface_post: update tests

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