9b27a5c513fe1ac2445026a79ef4be2a67f9bf24
1 from sqlalchemy
.exceptions
import IntegrityError
2 from floof
.tests
import *
3 from floof
.tests
import Session
, metadata
, Individual
, create_all
, drop_all
5 class TestMyModel(TestModel
):
7 def test_simpleassert(self
):
10 einstein
= Individual('einstein')
14 ind1
= Individual
.get_by(name
= 'einstein')
15 assert ind1
== einstein
17 def test_exception(self
):
18 me
= Individual('giuseppe')
19 me_again
= Individual('giuseppe')
20 self
.assertRaises(IntegrityError
, Session
.commit
)