After finding a bug in a filter that caused it to return incomplete
results in master (not yet patched), I decided to develop tests for the
filter rules. This first batch is all listed person filter rules that
either take no parameters or take a single ID parameter. I originally
wanted to use the smaller data.gramps instead of example.gramps, but
there were more unrepresented edge cases that wouldn't allow for testing
all filters (e.g. disconnected individuals).
All test values are based on what Gramps currently returns, with some
efforts made to try to verify the results. If the example.gramps file
changes, these tests will likely have to be updated. I tried to
cross-version validate them with v4.1, but the implementation of
DictionaryDb is too incomplete and many tests fail for unrelated
reasons.
I can never remember which category filters are in when making a new
rule. This change adds a filter entry above the treeview. As you type,
filters that do not contain the search text (case insensitively) are
made not visible. Categories are always visible, but will no longer
expand if all of their child nodes are hidden.
These issues were all found while trying to use the "Calculate Previews"
feature of the export wizard.
gen/proxy/referencedbyselection.py: ProxyDbBase need not define the
writable functions (add_*, commit_*, del_*) in its __tables. ProxyDbBase
doesn't have methods for add_person, etc, so this was causing an
AttributeError
gen/proxy/referencedbyselection.py: Add some handle checks to prevent
lookups on None handles
gen/proxy/proxybase.py: remove redundant test
db.select() has become db._select()
This commit refactors database._tables so that they can work properly
after a proxy or filter has been removed.
It adds abstract API called QuerySet which allows a variety of
selections and ordering of data.
Logging was added to sqlite to better see db access.
Additional fixes:
* clearing GenericDB._directory
* test_util_test off-by-one error