Mercurial > p > roundup > code
comparison test/test_db.py @ 270:a4241ddd22d7
Added the Password property type.
See "pydoc roundup.password" for implementation details. Have updated
some of the documentation too.
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Tue, 09 Oct 2001 07:25:59 +0000 |
| parents | 1e571b6be57a |
| children | a28a80b714f9 |
comparison
equal
deleted
inserted
replaced
| 269:82cfd78f3c4e | 270:a4241ddd22d7 |
|---|---|
| 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: test_db.py,v 1.7 2001-08-29 06:23:59 richard Exp $ | 18 # $Id: test_db.py,v 1.8 2001-10-09 07:25:59 richard Exp $ |
| 19 | 19 |
| 20 import unittest, os, shutil | 20 import unittest, os, shutil |
| 21 | 21 |
| 22 from roundup.hyperdb import String, Link, Multilink, Date, Interval, Class, \ | 22 from roundup.hyperdb import String, Password, Link, Multilink, Date, \ |
| 23 DatabaseError | 23 Interval, Class, DatabaseError |
| 24 | 24 |
| 25 def setupSchema(db, create): | 25 def setupSchema(db, create): |
| 26 status = Class(db, "status", name=String()) | 26 status = Class(db, "status", name=String()) |
| 27 status.setkey("name") | 27 status.setkey("name") |
| 28 if create: | 28 if create: |
| 29 status.create(name="unread") | 29 status.create(name="unread") |
| 30 status.create(name="in-progress") | 30 status.create(name="in-progress") |
| 31 status.create(name="testing") | 31 status.create(name="testing") |
| 32 status.create(name="resolved") | 32 status.create(name="resolved") |
| 33 Class(db, "user", username=String(), password=String()) | 33 Class(db, "user", username=String(), password=Password()) |
| 34 Class(db, "issue", title=String(), status=Link("status"), | 34 Class(db, "issue", title=String(), status=Link("status"), |
| 35 nosy=Multilink("user")) | 35 nosy=Multilink("user")) |
| 36 | 36 |
| 37 #class MyTestResult(unittest._TestResult): | 37 #class MyTestResult(unittest._TestResult): |
| 38 # def addError(self, test, err): | 38 # def addError(self, test, err): |
| 240 | 240 |
| 241 return unittest.TestSuite(l) | 241 return unittest.TestSuite(l) |
| 242 | 242 |
| 243 # | 243 # |
| 244 # $Log: not supported by cvs2svn $ | 244 # $Log: not supported by cvs2svn $ |
| 245 # Revision 1.7 2001/08/29 06:23:59 richard | |
| 246 # Disabled the bsddb3 module entirely in the unit testing. See CHANGES for | |
| 247 # details. | |
| 248 # | |
| 245 # Revision 1.6 2001/08/07 00:24:43 richard | 249 # Revision 1.6 2001/08/07 00:24:43 richard |
| 246 # stupid typo | 250 # stupid typo |
| 247 # | 251 # |
| 248 # Revision 1.5 2001/08/07 00:15:51 richard | 252 # Revision 1.5 2001/08/07 00:15:51 richard |
| 249 # Added the copyright/license notice to (nearly) all files at request of | 253 # Added the copyright/license notice to (nearly) all files at request of |
