Mercurial > genshi > genshi-test
comparison examples/turbogears/markuptest/tests/test_model.py @ 4:f8612f05af99
Added first stab of an implementation of the !TurboGears [http://www.turbogears.org/docs/plugins/template.html plugin API for template engines], and also a !TurboGears-based example using this plugin. Both written by Matt Good.
author | cmlenz |
---|---|
date | Sat, 03 Jun 2006 12:31:58 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
3:e86dcec16d55 | 4:f8612f05af99 |
---|---|
1 # If your project uses a database, you can set up database tests | |
2 # similar to what you see below. Be sure to set the db_uri to | |
3 # an appropriate uri for your testing database. sqlite is a good | |
4 # choice for testing, because you can use an in-memory database | |
5 # which is very fast. | |
6 | |
7 from turbogears import testutil | |
8 # from markuptest.model import YourDataClass, User | |
9 | |
10 # database.set_db_uri("sqlite:///:memory:") | |
11 | |
12 # class TestUser(testutil.DBTest): | |
13 # def get_model(self): | |
14 # return User | |
15 # | |
16 # def test_creation(self): | |
17 # "Object creation should set the name" | |
18 # obj = User(user_name = "creosote", | |
19 # email_address = "spam@python.not", | |
20 # display_name = "Mr Creosote", | |
21 # password = "Wafer-thin Mint") | |
22 # assert obj.display_name == "Mr Creosote" | |
23 |