cmlenz@4: # If your project uses a database, you can set up database tests cmlenz@4: # similar to what you see below. Be sure to set the db_uri to cmlenz@4: # an appropriate uri for your testing database. sqlite is a good cmlenz@4: # choice for testing, because you can use an in-memory database cmlenz@4: # which is very fast. cmlenz@4: cmlenz@4: from turbogears import testutil cmlenz@230: # from genshitest.model import YourDataClass, User cmlenz@4: cmlenz@4: # database.set_db_uri("sqlite:///:memory:") cmlenz@4: cmlenz@4: # class TestUser(testutil.DBTest): cmlenz@4: # def get_model(self): cmlenz@4: # return User cmlenz@4: # cmlenz@4: # def test_creation(self): cmlenz@4: # "Object creation should set the name" cmlenz@4: # obj = User(user_name = "creosote", cmlenz@4: # email_address = "spam@python.not", cmlenz@4: # display_name = "Mr Creosote", cmlenz@4: # password = "Wafer-thin Mint") cmlenz@4: # assert obj.display_name == "Mr Creosote" cmlenz@4: