Commit 5e23015c authored by Arnaud Fontaine's avatar Arnaud Fontaine

erp5_accounting_l10n_fr: 'at_date' in FEC Dialog requires month/day so these...

erp5_accounting_l10n_fr: 'at_date' in FEC Dialog requires month/day so these should be in the generated filename too.
parent 333886df
...@@ -13,7 +13,7 @@ fec_file = context.AccountingTransactionModule_viewComptabiliteAsFECXML( ...@@ -13,7 +13,7 @@ fec_file = context.AccountingTransactionModule_viewComptabiliteAsFECXML(
result_list=result_list) result_list=result_list)
zipbuffer = StringIO() zipbuffer = StringIO()
zipfilename = at_date.strftime('FEC-%Y.zip') zipfilename = at_date.strftime('FEC-%Y%m%d.zip')
zipfileobj = zipfile.ZipFile(zipbuffer, 'w', compression=zipfile.ZIP_DEFLATED) zipfileobj = zipfile.ZipFile(zipbuffer, 'w', compression=zipfile.ZIP_DEFLATED)
zipfileobj.writestr('FEC.xml', fec_file.encode('utf8')) zipfileobj.writestr('FEC.xml', fec_file.encode('utf8'))
zipfileobj.close() zipfileobj.close()
......
...@@ -136,7 +136,7 @@ class TestAccounting_l10n_fr(AccountingTestCase): ...@@ -136,7 +136,7 @@ class TestAccounting_l10n_fr(AccountingTestCase):
for part in mail_message.walk(): for part in mail_message.walk():
content_type = part.get_content_type() content_type = part.get_content_type()
file_name = part.get_filename() file_name = part.get_filename()
if file_name == 'FEC-2014.zip': if file_name == 'FEC-20141231.zip':
self.assertEqual('application/zip', content_type) self.assertEqual('application/zip', content_type)
data = part.get_payload(decode=True) data = part.get_payload(decode=True)
zf = zipfile.ZipFile(StringIO(data)) zf = zipfile.ZipFile(StringIO(data))
...@@ -228,7 +228,7 @@ class TestAccounting_l10n_fr(AccountingTestCase): ...@@ -228,7 +228,7 @@ class TestAccounting_l10n_fr(AccountingTestCase):
for part in mail_message.walk(): for part in mail_message.walk():
content_type = part.get_content_type() content_type = part.get_content_type()
file_name = part.get_filename() file_name = part.get_filename()
if file_name == 'FEC-2014.zip': if file_name == 'FEC-20141231.zip':
self.assertEqual('application/zip', content_type) self.assertEqual('application/zip', content_type)
data = part.get_payload(decode=True) data = part.get_payload(decode=True)
zf = zipfile.ZipFile(StringIO(data)) zf = zipfile.ZipFile(StringIO(data))
......
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