Commit 644ea989 authored by Vincent Pelletier's avatar Vincent Pelletier

testRelationField: Test actual indexation, not only activity presence.

This avoids relying on implementation details by only relying on regular
API. This test should now be more robust in face of implementation changes.
parent 3abb3620
......@@ -57,8 +57,12 @@ class TestMultiRelationField(ERP5TypeTestCase):
['Category'], [('Category', 'Category')], 'title', '',
[([category.getUid()], category.getUid(), category.getId(),
None, 'subfield_field_my_foo_category_title_item')], '')
self.assertFalse(foo_object.hasActivity(method_id="recursiveImmediateReindexObject"))
foo_path = foo_object.getPath()
foo_uid = foo_object.getUid()
self.assertEqual([x.path for x in self.portal.portal_catalog(uid=foo_uid)], [foo_path])
foo_object.unindexObject()
self.tic()
self.assertEqual([x.path for x in self.portal.portal_catalog(uid=foo_uid)], [])
editor.edit(foo_object)
self.commit()
self.assertTrue(foo_object.hasActivity(method_id="recursiveImmediateReindexObject"))
self.tic()
self.assertEqual([x.path for x in self.portal.portal_catalog(uid=foo_uid)], [foo_path])
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