X-Git-Url: http://git.veekun.com/zzz-floof.git/blobdiff_plain/e080215f07b8153ef01d6c840a4ba3a4bfc2d770..ef69b26ffcf9185496775bcf73384ea3a5e5691c:/floof/tests/test_models.py diff --git a/floof/tests/test_models.py b/floof/tests/test_models.py index e69de29..9b27a5c 100644 --- a/floof/tests/test_models.py +++ b/floof/tests/test_models.py @@ -0,0 +1,22 @@ +from sqlalchemy.exceptions import IntegrityError +from floof.tests import * +from floof.tests import Session, metadata, Individual, create_all, drop_all + +class TestMyModel(TestModel): + + def test_simpleassert(self): + """test description + """ + einstein = Individual('einstein') + + Session.commit() + + ind1 = Individual.get_by(name = 'einstein') + assert ind1 == einstein + + def test_exception(self): + me = Individual('giuseppe') + me_again = Individual('giuseppe') + self.assertRaises(IntegrityError, Session.commit) + Session.rollback() +