summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 71a0713)
raw | patch | inline | side by side (parent: 71a0713)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Mon, 21 Apr 2003 22:38:48 +0000 (22:38 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Mon, 21 Apr 2003 22:38:48 +0000 (22:38 +0000) |
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1670 57a73879-2fb5-44c3-a270-3262357dd7e2
test/test_db.py | patch | blob | history |
diff --git a/test/test_db.py b/test/test_db.py
index 08a3ea5f1a8bb12c9572d43c634b2ad379dbdee4..8fc18d4b2e43a2708f1494d103a52096331c6936 100644 (file)
--- a/test/test_db.py
+++ b/test/test_db.py
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#
-# $Id: test_db.py,v 1.86 2003-04-21 14:29:40 kedder Exp $
+# $Id: test_db.py,v 1.87 2003-04-21 22:38:48 richard Exp $
import unittest, os, shutil, time
'foo': date.Interval('1d'),
'deadline': date.Date('2003-02-16.22:50')},
{'title': 'issue three', 'status': '1',
- 'nosy': ['1','2'], 'deadline': date.Date('2003-03-08')}):
+ 'nosy': ['1','2'], 'deadline': date.Date('2003-02-18')},
+ {'title': 'non four', 'status': '3',
+ 'foo': date.Interval('0:10'),
+ 'nosy': ['1'], 'deadline': date.Date('2004-03-08')}):
self.db.issue.create(**issue)
self.db.commit()
return self.assertEqual, self.db.issue.filter
def testFilteringRange(self):
ae, filt = self.filteringSetup()
# Date ranges
- ae(filt(None, {'deadline': 'from 2003-02-10 to 2003-02-23'}), ['2'])
- ae(filt(None, {'deadline': '2003-02-10; 2003-02-23'}), ['2'])
+ ae(filt(None, {'deadline': 'from 2003-02-10 to 2003-02-23'}), ['2','3'])
+ ae(filt(None, {'deadline': '2003-02-10; 2003-02-23'}), ['2','3'])
ae(filt(None, {'deadline': '; 2003-02-16'}), ['1'])
# Lets assume people won't invent a time machine, otherwise this test
# may fail :)
- ae(filt(None, {'deadline': 'from 2003-02-16'}), ['2', '3'])
- ae(filt(None, {'deadline': '2003-02-16;'}), ['2', '3'])
+ ae(filt(None, {'deadline': 'from 2003-02-16'}), ['2', '3', '4'])
+ ae(filt(None, {'deadline': '2003-02-16;'}), ['2', '3', '4'])
+ # year and month granularity
+ ae(filt(None, {'deadline': '2003'}), ['1', '2', '3'])
+ ae(filt(None, {'deadline': '2004'}), ['4'])
+ ae(filt(None, {'deadline': '2003-02'}), ['2', '3'])
+ ae(filt(None, {'deadline': '2003-03'}), [])
+ ae(filt(None, {'deadline': '2003-02-16'}), ['2'])
+ ae(filt(None, {'deadline': '2003-02-17'}), [])
# Interval ranges
ae(filt(None, {'foo': 'from 0:50 to 2:00'}), ['1'])
ae(filt(None, {'foo': 'from 0:50 to 1d 2:00'}), ['1', '2'])
def testFilteringIntervalSort(self):
ae, filt = self.filteringSetup()
# ascending should sort None, 1:10, 1d
- ae(filt(None, {}, ('+','foo'), (None,None)), ['3', '1', '2'])
+ ae(filt(None, {}, ('+','foo'), (None,None)), ['3', '4', '1', '2'])
# descending should sort 1d, 1:10, None
- ae(filt(None, {}, ('-','foo'), (None,None)), ['2', '1', '3'])
+ ae(filt(None, {}, ('-','foo'), (None,None)), ['2', '1', '4', '3'])
# XXX add sorting tests for other types
# XXX test auditors and reactors