1515# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717#
18- # $Id: test_db.py,v 1.38 2002-07-26 08:27:00 richard Exp $
18+ # $Id: test_db.py,v 1.39 2002-07-31 23:57:37 richard Exp $
1919
2020import unittest , os , shutil , time
2121
@@ -90,12 +90,16 @@ def testStringChange(self):
9090 self .assertEqual (self .db .issue .get ('2' , 'title' ), 'ham' )
9191 self .db .commit ()
9292 self .assertEqual (self .db .issue .get ('2' , 'title' ), 'ham' )
93+ self .db .issue .set ('1' , title = None )
94+ self .assertEqual (self .db .issue .get ('1' , "title" ), None )
9395
9496 def testLinkChange (self ):
9597 self .db .issue .create (title = "spam" , status = '1' )
9698 self .assertEqual (self .db .issue .get ('1' , "status" ), '1' )
9799 self .db .issue .set ('1' , status = '2' )
98100 self .assertEqual (self .db .issue .get ('1' , "status" ), '2' )
101+ self .db .issue .set ('1' , status = None )
102+ self .assertEqual (self .db .issue .get ('1' , "status" ), None )
99103
100104 def testDateChange (self ):
101105 self .db .issue .create (title = "spam" , status = '1' )
@@ -106,12 +110,16 @@ def testDateChange(self):
106110 self .assertNotEqual (a , b )
107111 self .assertNotEqual (b , date .Date ('1970-1-1 00:00:00' ))
108112 self .db .issue .set ('1' , deadline = date .Date ())
113+ self .db .issue .set ('1' , deadline = None )
114+ self .assertEqual (self .db .issue .get ('1' , "deadline" ), None )
109115
110116 def testIntervalChange (self ):
111117 self .db .issue .create (title = "spam" , status = '1' )
112118 a = self .db .issue .get ('1' , "foo" )
113119 self .db .issue .set ('1' , foo = date .Interval ('-1d' ))
114120 self .assertNotEqual (self .db .issue .get ('1' , "foo" ), a )
121+ self .db .issue .set ('1' , foo = None )
122+ self .assertEqual (self .db .issue .get ('1' , "foo" ), None )
115123
116124 def testBooleanChange (self ):
117125 userid = self .db .user .create (username = 'foo' , assignable = 1 )
@@ -121,13 +129,17 @@ def testBooleanChange(self):
121129 self .assertNotEqual (self .db .user .get (userid , 'assignable' ), a )
122130 self .db .user .set (userid , assignable = 0 )
123131 self .db .user .set (userid , assignable = 1 )
132+ self .db .user .set ('1' , assignable = None )
133+ self .assertEqual (self .db .user .get ('1' , "assignable" ), None )
124134
125135 def testNumberChange (self ):
126136 self .db .user .create (username = 'foo' , age = '1' )
127137 a = self .db .user .get ('1' , 'age' )
128138 self .db .user .set ('1' , age = '3' )
129139 self .assertNotEqual (self .db .user .get ('1' , 'age' ), a )
130140 self .db .user .set ('1' , age = '1.0' )
141+ self .db .user .set ('1' , age = None )
142+ self .assertEqual (self .db .user .get ('1' , "age" ), None )
131143
132144 def testNewProperty (self ):
133145 self .db .issue .create (title = "spam" , status = '1' )
@@ -576,7 +588,7 @@ def suite():
576588 unittest .makeSuite (anydbmDBTestCase , 'test' ),
577589 unittest .makeSuite (anydbmReadOnlyDBTestCase , 'test' )
578590 ]
579- # return unittest.TestSuite(l)
591+ # return unittest.TestSuite(l)
580592
581593 try :
582594 import bsddb
@@ -603,6 +615,11 @@ def suite():
603615
604616#
605617# $Log: not supported by cvs2svn $
618+ # Revision 1.38 2002/07/26 08:27:00 richard
619+ # Very close now. The cgi and mailgw now use the new security API. The two
620+ # templates have been migrated to that setup. Lots of unit tests. Still some
621+ # issue in the web form for editing Roles assigned to users.
622+ #
606623# Revision 1.37 2002/07/25 07:14:06 richard
607624# Bugger it. Here's the current shape of the new security implementation.
608625# Still to do:
0 commit comments