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
7 from turbogears import testutil, database
8 from sercom.model import Curso
10 database.set_db_uri("sqlite:///:memory:")
12 class TestCurso(testutil.DBTest):
15 def test_creation(self):
16 "Object creation should set the name"
17 c = Curso(anio=2007, cuatrimestre=1, numero=1)
19 assert c.cuatrimestre == 1
21 assert c.docentes == []
22 assert c.alumnos == []
24 assert c.ejercicios == []