Created
September 11, 2014 14:41
-
-
Save mgedmin/a8d9006166e301cee534 to your computer and use it in GitHub Desktop.
Zope 2 is wonderful
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This is what I need to do if I want to import a .zexp from Zope 2.12 because there's apparently some object in the ZODB that got removed in 2.11 days | |
| import mock | |
| sys.modules['Products.PluginIndexes.TextIndex'] = mock.Mock() | |
| sys.modules['Products.PluginIndexes.TextIndex.Splitter'] = mock.Mock() | |
| sys.modules['Products.PluginIndexes.TextIndex.Splitter.ZopeSplitter'] = mock.Mock() | |
| from persistent import Persistent | |
| sys.modules['Products.PluginIndexes.TextIndex.Splitter.ZopeSplitter'].ZopeSplitter = type('ZopeSplitter', (Persistent,), {'__module__': 'Products.PluginIndexes.TextIndex.Splitter.ZopeSplitter'}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi Marius,
I'm trying to import .zexp from Zope 2.5.1/Python 2.1.3 to Zope 2.13.24/Python 2.7.5. First error I've got was 'No module named TextIndex.Splitter.ZopeSplitter'. I hope mocking PluginIndexes may help. But where do you suggest to put the code that mocks it?