~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to loggerhead/tests/test_model.py

  • Committer: Martin Albisetti
  • Date: 2008-07-29 20:42:35 UTC
  • mto: This revision was merged to the branch mainline in revision 188.
  • Revision ID: argentina@gmail.com-20080729204235-nhhd02ll6vegonqp
Ignore build/

Show diffs side-by-side

added added

removed removed

Lines of Context:
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, database
8
 
# from loggerhead.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
 
#     def test_creation(self):
16
 
#         "Object creation should set the name"
17
 
#         obj = User(user_name = "creosote",
18
 
#                       email_address = "spam@python.not",
19
 
#                       display_name = "Mr Creosote",
20
 
#                       password = "Wafer-thin Mint")
21
 
#         assert obj.display_name == "Mr Creosote"
22