fix test case to work with reindex_reference_map

svn: r7795
This commit is contained in:
Richard Taylor 2006-12-13 10:03:52 +00:00
parent f2eb4451b6
commit 190d20fcee
2 changed files with 8 additions and 1 deletions

View File

@ -1,3 +1,7 @@
2006-12-13 Richard Taylor <rjt-gramps@thegrindstone.me.uk>
* test/GrampsDb/GrampsDbBase_Test.py: fix test case to work with
reindex_reference_map
2006-12-13 Martin Hawlisch <Martin.Hawlisch@gmx.de> 2006-12-13 Martin Hawlisch <Martin.Hawlisch@gmx.de>
* src/Filters/Rules/Person/_HasRelationship.py: Fix FamilyRelType * src/Filters/Rules/Person/_HasRelationship.py: Fix FamilyRelType
comparison (closes #758) comparison (closes #758)

View File

@ -153,6 +153,9 @@ class ReferenceMapTest (GrampsDbBaseTest):
def test_reindex_reference_map(self): def test_reindex_reference_map(self):
"""Test that the reindex function works.""" """Test that the reindex function works."""
def cb(count):
pass
# unhook the reference_map update function so that we # unhook the reference_map update function so that we
# can insert some records without the reference_map being updated. # can insert some records without the reference_map being updated.
update_method = self._db._update_reference_map update_method = self._db._update_reference_map
@ -169,7 +172,7 @@ class ReferenceMapTest (GrampsDbBaseTest):
# Reinstate the reference_map method and reindex the database # Reinstate the reference_map method and reindex the database
self._db._update_reference_map = update_method self._db._update_reference_map = update_method
self._db.reindex_reference_map() self._db.reindex_reference_map(cb)
# Check that the reference now appears in the reference_map # Check that the reference now appears in the reference_map
references = [ ref for ref in self._db.find_backlink_handles(source.get_handle()) ] references = [ ref for ref in self._db.find_backlink_handles(source.get_handle()) ]