Commits

Dan Connolly committed 1459a71

toward coverage testing: never mind unit tests; we use doctest

  • Participants
  • Parent commits 5c4d0fd

Comments (0)

Files changed (1)

File finquick/finquick/tests.py

-import unittest
-import transaction
-
-from pyramid import testing
-
-from .models import DBSession
-
-class TestMyView(unittest.TestCase):
-    def setUp(self):
-        self.config = testing.setUp()
-        from sqlalchemy import create_engine
-        engine = create_engine('sqlite://')
-        from .models import (
-            Base,
-            MyModel,
-            )
-        DBSession.configure(bind=engine)
-        Base.metadata.create_all(engine)
-        with transaction.manager:
-            model = MyModel(name='one', value=55)
-            DBSession.add(model)
-
-    def tearDown(self):
-        DBSession.remove()
-        testing.tearDown()
-
-    def test_it(self):
-        from .views import my_view
-        request = testing.DummyRequest()
-        info = my_view(request)
-        self.assertEqual(info['one'].name, 'one')
-        self.assertEqual(info['project'], 'finquick')