ERP5TypeTestCase: backport Zope pull request 1059

This is a simplified version that works well enough for python 2.
For Zope 4 and python 3 we are considering reusing publish.
4 jobs for fix/publish_encoded