Mercurial > p > roundup > code
comparison test/db_test_base.py @ 2536:70ede89e8056
handle postgresql bug in SQL generation [SF#984591]
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Sat, 03 Jul 2004 23:05:15 +0000 |
| parents | 0a63854816ee |
| children | 113548baeed2 |
comparison
equal
deleted
inserted
replaced
| 2534:fc6cef8ff0b3 | 2536:70ede89e8056 |
|---|---|
| 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.38 2004-07-03 22:43:59 richard Exp $ | 18 # $Id: db_test_base.py,v 1.39 2004-07-03 23:05:15 richard Exp $ |
| 19 | 19 |
| 20 import unittest, os, shutil, errno, imp, sys, time, pprint | 20 import unittest, os, shutil, errno, imp, sys, time, pprint |
| 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 |
| 834 {'username': 'blorp', 'age': 2}): | 834 {'username': 'blorp', 'age': 2}): |
| 835 self.db.user.create(**user) | 835 self.db.user.create(**user) |
| 836 iss = self.db.issue | 836 iss = self.db.issue |
| 837 for issue in ( | 837 for issue in ( |
| 838 {'title': 'issue one', 'status': '2', 'assignedto': '1', | 838 {'title': 'issue one', 'status': '2', 'assignedto': '1', |
| 839 'foo': date.Interval('1:10'), 'priority': '1', | 839 'foo': date.Interval('1:10'), 'priority': '3', |
| 840 'deadline': date.Date('2003-01-01.00:00')}, | 840 'deadline': date.Date('2003-01-01.00:00')}, |
| 841 {'title': 'issue two', 'status': '1', 'assignedto': '2', | 841 {'title': 'issue two', 'status': '1', 'assignedto': '2', |
| 842 'foo': date.Interval('1d'), 'priority': '3', | 842 'foo': date.Interval('1d'), 'priority': '3', |
| 843 'deadline': date.Date('2003-02-16.22:50')}, | 843 'deadline': date.Date('2003-02-16.22:50')}, |
| 844 {'title': 'issue three', 'status': '1', 'priority': '2', | 844 {'title': 'issue three', 'status': '1', 'priority': '2', |
| 845 'nosy': ['1','2'], 'deadline': date.Date('2003-02-18')}, | 845 'nosy': ['1','2'], 'deadline': date.Date('2003-02-18')}, |
| 846 {'title': 'non four', 'status': '3', | 846 {'title': 'non four', 'status': '3', |
| 847 'foo': date.Interval('0:10'), 'priority': '1', | 847 'foo': date.Interval('0:10'), 'priority': '2', |
| 848 'nosy': ['1'], 'deadline': date.Date('2004-03-08')}): | 848 'nosy': ['1'], 'deadline': date.Date('2004-03-08')}): |
| 849 self.db.issue.create(**issue) | 849 self.db.issue.create(**issue) |
| 850 file_content = ''.join([chr(i) for i in range(255)]) | 850 file_content = ''.join([chr(i) for i in range(255)]) |
| 851 self.db.file.create(content=file_content) | 851 self.db.file.create(content=file_content) |
| 852 self.db.commit() | 852 self.db.commit() |
| 891 | 891 |
| 892 def testFilteringMultilink(self): | 892 def testFilteringMultilink(self): |
| 893 ae, filt = self.filteringSetup() | 893 ae, filt = self.filteringSetup() |
| 894 ae(filt(None, {'nosy': '2'}, ('+','id'), (None,None)), ['3']) | 894 ae(filt(None, {'nosy': '2'}, ('+','id'), (None,None)), ['3']) |
| 895 ae(filt(None, {'nosy': '-1'}, ('+','id'), (None,None)), ['1', '2']) | 895 ae(filt(None, {'nosy': '-1'}, ('+','id'), (None,None)), ['1', '2']) |
| 896 ae(filt(None, {'nosy': ['1','2']}, ('+', 'status'), | |
| 897 ('-', 'activity')), ['4', '3']) | |
| 896 | 898 |
| 897 def testFilteringMany(self): | 899 def testFilteringMany(self): |
| 898 ae, filt = self.filteringSetup() | 900 ae, filt = self.filteringSetup() |
| 899 ae(filt(None, {'nosy': '2', 'status': '1'}, ('+','id'), (None,None)), | 901 ae(filt(None, {'nosy': '2', 'status': '1'}, ('+','id'), (None,None)), |
| 900 ['3']) | 902 ['3']) |
