Mercurial > p > roundup > code
comparison test/db_test_base.py @ 3636:fa7becc62534
Of course for Links there is the same bug as I fixed before for multilinks.
But it turns out that searching for None is valid for a link. So we
can't use None as a guard in support.Proptree, I introduced the
has_values flag there and use it in the sql search too.
| author | Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net> |
|---|---|
| date | Thu, 13 Jul 2006 13:30:39 +0000 |
| parents | 53987aa153d2 |
| children | f3785d646f22 |
comparison
equal
deleted
inserted
replaced
| 3635:53987aa153d2 | 3636:fa7becc62534 |
|---|---|
| 13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | 13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
| 14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" | 14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" |
| 15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, | 15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, |
| 16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. | 16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
| 17 # | 17 # |
| 18 # $Id: db_test_base.py,v 1.71 2006-07-13 10:14:56 schlatterbeck Exp $ | 18 # $Id: db_test_base.py,v 1.72 2006-07-13 13:30:39 schlatterbeck Exp $ |
| 19 | 19 |
| 20 import unittest, os, shutil, errno, imp, sys, time, pprint, sets | 20 import unittest, os, shutil, errno, imp, sys, time, pprint, sets |
| 21 | 21 |
| 22 from roundup.hyperdb import String, Password, Link, Multilink, Date, \ | 22 from roundup.hyperdb import String, Password, Link, Multilink, Date, \ |
| 23 Interval, DatabaseError, Boolean, Number, Node | 23 Interval, DatabaseError, Boolean, Number, Node |
| 975 def testFilteringLink(self): | 975 def testFilteringLink(self): |
| 976 ae, filt = self.filteringSetup() | 976 ae, filt = self.filteringSetup() |
| 977 ae(filt(None, {'status': '1'}, ('+','id'), (None,None)), ['2','3']) | 977 ae(filt(None, {'status': '1'}, ('+','id'), (None,None)), ['2','3']) |
| 978 ae(filt(None, {'assignedto': '-1'}, ('+','id'), (None,None)), ['3','4']) | 978 ae(filt(None, {'assignedto': '-1'}, ('+','id'), (None,None)), ['3','4']) |
| 979 ae(filt(None, {'assignedto': None}, ('+','id'), (None,None)), ['3','4']) | 979 ae(filt(None, {'assignedto': None}, ('+','id'), (None,None)), ['3','4']) |
| 980 ae(filt(None, {'assignedto': [None]}, ('+','id'), (None,None)), | |
| 981 ['3','4']) | |
| 980 ae(filt(None, {'assignedto': ['-1', None]}, ('+','id'), (None,None)), | 982 ae(filt(None, {'assignedto': ['-1', None]}, ('+','id'), (None,None)), |
| 981 ['3','4']) | 983 ['3','4']) |
| 982 ae(filt(None, {'assignedto': ['1', None]}, ('+','id'), (None,None)), | 984 ae(filt(None, {'assignedto': ['1', None]}, ('+','id'), (None,None)), |
| 983 ['1', '3','4']) | 985 ['1', '3','4']) |
| 984 | 986 |
| 1146 ae(ufilt(None, {'supervisor.username': 'grouplead2'}, ('+','username')), | 1148 ae(ufilt(None, {'supervisor.username': 'grouplead2'}, ('+','username')), |
| 1147 ['8', '9', '10']) | 1149 ['8', '9', '10']) |
| 1148 ae(ufilt(None, {'supervisor.username': 'grouplead2', | 1150 ae(ufilt(None, {'supervisor.username': 'grouplead2', |
| 1149 'supervisor.supervisor.username': 'ceo'}, ('+','username')), | 1151 'supervisor.supervisor.username': 'ceo'}, ('+','username')), |
| 1150 ['8', '9', '10']) | 1152 ['8', '9', '10']) |
| 1153 ae(ufilt(None, {'supervisor.supervisor': '3', 'supervisor': '4'}, | |
| 1154 ('+','username')), ['6', '7']) | |
| 1151 | 1155 |
| 1152 def testFilteringTransitiveLinkIssue(self): | 1156 def testFilteringTransitiveLinkIssue(self): |
| 1153 ae, filt = self.filteringSetupTransitiveSearch() | 1157 ae, filt = self.filteringSetupTransitiveSearch() |
| 1154 ae(filt(None, {'assignedto.supervisor.username': 'grouplead1'}, | 1158 ae(filt(None, {'assignedto.supervisor.username': 'grouplead1'}, |
| 1155 ('+','id')), ['1', '2', '3']) | 1159 ('+','id')), ['1', '2', '3']) |
