Files @ c9b0c7cf50ed
Branch filter:

Location: rattail-project/rattail/tests/db/__init__.py

lance
Removed reliance on `edbob.db.engines`.

import unittest

from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker

from rattail.db.model import Base


__all__ = ['DataTestCase']


class DataTestCase(unittest.TestCase):

    def setUp(self):
        engine = create_engine('sqlite://')
        Base.metadata.create_all(bind=engine)
        self.Session = sessionmaker(bind=engine)
        self.session = self.Session()

    def tearDown(self):
        self.session.close()