Commit a3b32345 authored by Jérome Perrin's avatar Jérome Perrin Committed by Arnaud Fontaine

test: new testUpgradeInstanceWithOldDataFs

new test with ERP5-style workflow to cover python3 migration
parent 09076541
...@@ -62,6 +62,11 @@ class ERP5TypeTestSuite(TestSuite): ...@@ -62,6 +62,11 @@ class ERP5TypeTestSuite(TestSuite):
assert len(marker_connection_string) == len(actual_connection_string) assert len(marker_connection_string) == len(actual_connection_string)
with open(os.path.join(instance_home, 'var', 'Data.fs'), 'rb') as f: with open(os.path.join(instance_home, 'var', 'Data.fs'), 'rb') as f:
data_fs = f.read() data_fs = f.read()
# XXX adjust FileStorage "magic" number so that python3 ZODB accepts reading a
# ZODB for python2, we'll handle the data migration ourselves.
from ZODB._compat import FILESTORAGE_MAGIC
data_fs = FILESTORAGE_MAGIC + data_fs[len(FILESTORAGE_MAGIC):]
with open(os.path.join(instance_home, 'var', 'Data.fs'), 'wb') as f: with open(os.path.join(instance_home, 'var', 'Data.fs'), 'wb') as f:
f.write(data_fs.replace(marker_connection_string, actual_connection_string)) f.write(data_fs.replace(marker_connection_string, actual_connection_string))
......
This diff is collapsed.
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