Skip to content

Commit 39ccdff

Browse files
committed
Add test for rev multilink expressions
Test currently only works for sqlite and postgresql.
1 parent 5bedb01 commit 39ccdff

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

test/db_test_base.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2027,6 +2027,38 @@ def ls(x):
20272027
self.assertEqual(ls(self.db.user.get('4', ni)), ['1'])
20282028
self.assertEqual(ls(self.db.user.get('5', ni)), ['7'])
20292029

2030+
# Currently only works for sqlite and postgresql
2031+
@pytest.mark.xfail
2032+
def testFilteringRevMultilinkExpression(self):
2033+
ae, iiter = self.filteringSetupTransitiveSearch('user')
2034+
ni = 'nosy_issues'
2035+
self.db.issue.set('6', nosy=['3', '4', '5'])
2036+
self.db.issue.set('7', nosy=['5'])
2037+
# After this setup we have the following values for nosy:
2038+
# issue nosy
2039+
# 1: 4
2040+
# 2: 5
2041+
# 3:
2042+
# 4:
2043+
# 5:
2044+
# 6: 3, 4, 5
2045+
# 7: 5
2046+
# 8:
2047+
# Retire users '9' and '10' to reduce list
2048+
self.db.user.retire ('9')
2049+
self.db.user.retire ('10')
2050+
for filt in iiter():
2051+
# '1' or '2'
2052+
ae(filt(None, {ni: ['1', '2', '-4']}), ['4', '5'])
2053+
# '6' or '7'
2054+
ae(filt(None, {ni: ['6', '7', '-4']}), ['3', '4', '5'])
2055+
# '6' and '7'
2056+
ae(filt(None, {ni: ['6', '7', '-3']}), ['5'])
2057+
# '6' and not '1'
2058+
ae(filt(None, {ni: ['6', '1', '-2', '-3']}), ['3', '5'])
2059+
# '2' or empty (implicit or)
2060+
ae(filt(None, {ni: ['-1', '2']}), ['1', '2', '5', '6', '7', '8'])
2061+
20302062
def testFilteringMany(self):
20312063
ae, iiter = self.filteringSetup()
20322064
for f in iiter():

0 commit comments

Comments
 (0)