Code

fixes from changes today
authorrichard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2>
Tue, 8 Oct 2002 07:28:34 +0000 (07:28 +0000)
committerrichard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2>
Tue, 8 Oct 2002 07:28:34 +0000 (07:28 +0000)
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1326 57a73879-2fb5-44c3-a270-3262357dd7e2

roundup/roundupdb.py
test/test_db.py

index 65739b0bd9a38135c47c44b1a77e1a53dc9ef0fc..e94632babe073edde0046aa9bf6a94a0720560d7 100644 (file)
@@ -15,7 +15,7 @@
 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 # 
-# $Id: roundupdb.py,v 1.71 2002-10-08 04:11:13 richard Exp $
+# $Id: roundupdb.py,v 1.72 2002-10-08 07:28:34 richard Exp $
 
 __doc__ = """
 Extending hyperdb with types specific to issue-tracking.
@@ -291,8 +291,7 @@ class IssueClass:
         # then append a trailing slash if it is missing
         base = self.db.config.TRACKER_WEB 
         if (not isinstance(base , type('')) or
-            not base.startswith('http://') or
-            not base.startswith('https://')):
+            not (base.startswith('http://') or base.startswith('https://'))):
             base = "Configuration Error: TRACKER_WEB isn't a " \
                 "fully-qualified URL"
         elif base[-1] != '/' :
index fe4faa681b6d903c5143ea4683174d72a0b3f5a6..46ecab9238ed0faeb8695df3580c8907c8802f5a 100644 (file)
@@ -15,7 +15,7 @@
 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 # 
-# $Id: test_db.py,v 1.58 2002-10-03 06:56:30 richard Exp $ 
+# $Id: test_db.py,v 1.59 2002-10-08 07:28:34 richard Exp $ 
 
 import unittest, os, shutil, time
 
@@ -194,15 +194,15 @@ class anydbmDBTestCase(MyTestCase):
         self.assertNotEqual(a, self.db.status.list())
 
     def testSerialisation(self):
-        self.db.issue.create(title="spam", status='1',
+        nid = self.db.issue.create(title="spam", status='1',
             deadline=date.Date(), foo=date.Interval('-1d'))
         self.db.commit()
-        assert isinstance(self.db.issue.get('1', 'deadline'), date.Date)
-        assert isinstance(self.db.issue.get('1', 'foo'), date.Interval)
-        self.db.user.create(username="fozzy",
+        assert isinstance(self.db.issue.get(nid, 'deadline'), date.Date)
+        assert isinstance(self.db.issue.get(nid, 'foo'), date.Interval)
+        uid = self.db.user.create(username="fozzy",
             password=password.Password('t. bear'))
         self.db.commit()
-        assert isinstance(self.db.user.get('1', 'password'), password.Password)
+        assert isinstance(self.db.user.get(uid, 'password'), password.Password)
 
     def testTransactions(self):
         # remember the number of items we started