Commit 48f9024a authored by Jérome Perrin's avatar Jérome Perrin

fixup! fixup! web_shadir: PY3 compatibility

parent d7271ab2
......@@ -130,7 +130,12 @@ def WebSection_putFactory(self, name, typ, body):
filename=name,
discover_metadata=False)
return document.asContext(id=name)
# return a document for which getId() returns the name for _setObject to be
# called with id=name ( for WebSection_setObject ), but for which
# getRelativeUrl returns the relative url of the real document, for
# VirtualFolderMixin transactional variable cache between _setObject and
# _getOb
return document.asContext(getId=lambda: name)
# The following scripts are helpers to search & clean up shadir entries.
# XXX: Due to lack of View skin for shadir, external methods are currently
......
......@@ -107,6 +107,7 @@ class TestShaDir(ShaDirMixin, ERP5TypeTestCase):
self.assertEqual(self.key, data_set.getReference())
self.assertNotEqual(self.key, data_set.getId())
self.assertEqual('published', data_set.getValidationState())
self.assertEqual(len(self.portal.data_set_module.contentValues()), 1)
# Asserting Document
document = self.portal.portal_catalog.getResultValue(
......@@ -120,6 +121,7 @@ class TestShaDir(ShaDirMixin, ERP5TypeTestCase):
str(document.getExpirationDate()))
self.assertEqual('application/json', document.getContentType())
self.assertEqual('Published', document.getValidationStateTitle())
self.assertEqual(len(self.portal.document_module.contentValues()), 1)
def test_get_information(self):
"""
......
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