diff --git a/tests/db/__init__.py b/tests/db/__init__.py index b3ee7ead891c22515f37462840e2a9e0fa9b19cd..2382659ee0bdfa8fcb48542868ebdb04f16a7ea7 100644 --- a/tests/db/__init__.py +++ b/tests/db/__init__.py @@ -2,8 +2,8 @@ import unittest from sqlalchemy import create_engine +from sqlalchemy.orm import sessionmaker -from rattail.db import Session from rattail.db.model import Base @@ -15,7 +15,8 @@ class DataTestCase(unittest.TestCase): def setUp(self): engine = create_engine('sqlite://') Base.metadata.create_all(bind=engine) - self.session = Session(bind=engine) + self.Session = sessionmaker(bind=engine) + self.session = self.Session() def tearDown(self): self.session.close()