From bac36dfb75e60eb3d7c9ebbf679d63c0162a8641 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Sat, 10 Mar 2007 16:29:02 +0000 Subject: [PATCH 1/1] =?utf8?q?Agregar=20intento=20de=20test.=20Un=20intent?= =?utf8?q?o=20por=20agregar=20testcases.=20No=20andaba=20y=20desist=C3=AD?= =?utf8?q?=20de=20investigar=20m=C3=A1s=20por=20falta=20de=20tiempo=20pero?= =?utf8?q?=20lo=20subo=20para=20que=20quede.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- sercom/tests/test_model.py | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/sercom/tests/test_model.py b/sercom/tests/test_model.py index 2b96ca0..30c160d 100644 --- a/sercom/tests/test_model.py +++ b/sercom/tests/test_model.py @@ -5,18 +5,21 @@ # which is very fast. from turbogears import testutil, database -# from sercom.model import YourDataClass, User +from sercom.model import Curso -# database.set_db_uri("sqlite:///:memory:") +database.set_db_uri("sqlite:///:memory:") -# class TestUser(testutil.DBTest): -# def get_model(self): -# return User -# def test_creation(self): -# "Object creation should set the name" -# obj = User(user_name = "creosote", -# email_address = "spam@python.not", -# display_name = "Mr Creosote", -# password = "Wafer-thin Mint") -# assert obj.display_name == "Mr Creosote" +class TestCurso(testutil.DBTest): + def get_model(self): + return Curso + def test_creation(self): + "Object creation should set the name" + c = Curso(anio=2007, cuatrimestre=1, numero=1) + assert c.anio == 2007 + assert c.cuatrimestre == 1 + assert c.numero == 1 + assert c.docentes == [] + assert c.alumnos == [] + assert c.grupos == [] + assert c.ejercicios == [] -- 2.43.0