Tests: don't make home person the private person

This commit is contained in:
Doug Blank 2016-04-19 07:16:58 -04:00
parent f093c8bd79
commit 551edbb07a
2 changed files with 6 additions and 8 deletions

View File

@ -902,7 +902,7 @@
<objref hlink="_HHNT6D73QPKC0KWK2Y"/>
<childof hlink="_S7MT6D1JSGX9PZO27F"/>
</person>
<person handle="_PSNT6D0DDHJOBCFJWX" change="1370206720" id="I0037" priv="1">
<person handle="_PSNT6D0DDHJOBCFJWX" change="1370206720" id="I0037">
<gender>M</gender>
<name type="Birth Name">
<first>Edwin Michael</first>
@ -1144,7 +1144,7 @@
<eventref hlink="_bd750d46bfe3f54dc37" role="Primary"/>
<parentin hlink="_bd750af3e934b6d3934"/>
</person>
<person handle="_bd750fae3bf5fb52f41" change="1301943705" id="I0057">
<person handle="_bd750fae3bf5fb52f41" change="1301943705" id="I0057" priv="1">
<gender>F</gender>
<name type="Birth Name">
<first>Anna Louise</first>

View File

@ -197,18 +197,16 @@ class BSDDBTest(unittest.TestCase):
from gramps.gen.filters import GenericFilter
filter = GenericFilter()
filter.set_logical_op("or")
filter.add_rule(IsDescendantOf([self.db.get_default_person().gramps_id,
True]))
filter.add_rule(IsAncestorOf([self.db.get_default_person().gramps_id,
True]))
filter.add_rule(IsDescendantOf(["I0057", True]))
filter.add_rule(IsAncestorOf(["I0057", True]))
result = self.db.Person.filter(filter).count()
self.assertTrue(result == 15, result)
self.assertTrue(result == 14, result)
filter.where = lambda person: person.private == True
result = self.db.Person.filter(filter).count()
self.assertTrue(result == 1, result)
filter.where = lambda person: person.private != True
result = self.db.Person.filter(filter).count()
self.assertTrue(result == 14, result)
self.assertTrue(result == 13, result)
def test_filter_2(self):
result = self.db.Person.filter(lambda p: p.private).count()