Added parent property/links for comments, and a Return link on comment threads.
[zzz-floof.git] / floof / tests / test_models.py
index e69de29..9b27a5c 100644 (file)
@@ -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()
+