Commit 3b5a50a3 authored by Vincent Pelletier's avatar Vincent Pelletier

testERP5Catalog: Make test_IndexationContextIndependence more realistic.

parent 657e6b7e
...@@ -48,6 +48,10 @@ class IndexableDocument(ObjectManager): ...@@ -48,6 +48,10 @@ class IndexableDocument(ObjectManager):
__allow_access_to_unprotected_subobjects__ = 1 __allow_access_to_unprotected_subobjects__ = 1
isRADContent = 0 isRADContent = 0
def __init__(self, path):
super(IndexableDocument, self).__init__()
self._path = path
def getUid(self): def getUid(self):
uid = getattr(self, 'uid', None) uid = getattr(self, 'uid', None)
if uid is None: if uid is None:
...@@ -62,11 +66,17 @@ class IndexableDocument(ObjectManager): ...@@ -62,11 +66,17 @@ class IndexableDocument(ObjectManager):
raise AttributeError, name raise AttributeError, name
def getPath(self): def getPath(self):
return '' # Whatever return self._path
def getRelativeUrl(self): def getRelativeUrl(self):
return '' # Whatever return '' # Whatever
def getRootDocumentPath(self):
return '' # Whatever
def SearchableText(self):
return '' # Whatever
class FooDocument(IndexableDocument): class FooDocument(IndexableDocument):
def getReference(self): def getReference(self):
return 'foo' return 'foo'
...@@ -3315,8 +3325,8 @@ VALUES ...@@ -3315,8 +3325,8 @@ VALUES
# Create some dummy documents # Create some dummy documents
portal = self.getPortalObject() portal = self.getPortalObject()
portal.foo = FooDocument() portal.foo = FooDocument(portal.getPath() + '/foo')
portal.bar = BarDocument() portal.bar = BarDocument(portal.getPath() + '/bar')
# Get instances, wrapping them in acquisition context implicitely. # Get instances, wrapping them in acquisition context implicitely.
foo = portal.foo foo = portal.foo
......
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