Files
@ 23ee011f0419
Branch filter:
Location: rattail-project/rattail/tests/db/__init__.py - annotation
23ee011f0419
885 B
text/x-python
Make `get_sync_engines()` require a config object.
ba7cb6c7120b ba7cb6c7120b a2b13de31c61 ba7cb6c7120b ba7cb6c7120b 22a589773921 a2b13de31c61 18a754c2fc98 af24f82995c9 ba7cb6c7120b ba7cb6c7120b ba7cb6c7120b ba7cb6c7120b ba7cb6c7120b a2b13de31c61 a2b13de31c61 a2b13de31c61 a2b13de31c61 a2b13de31c61 a2b13de31c61 8004bb53154a a2b13de31c61 a2b13de31c61 ba7cb6c7120b ba7cb6c7120b ba7cb6c7120b 18a754c2fc98 18a754c2fc98 22a589773921 22a589773921 ba7cb6c7120b ba7cb6c7120b ba7cb6c7120b |
import unittest
import warnings
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from sqlalchemy.exc import SAWarning
from rattail.db.model import Base
__all__ = ['DataTestCase']
warnings.filterwarnings(
'ignore',
r"^Dialect sqlite\+pysqlite does \*not\* support Decimal objects natively\, "
"and SQLAlchemy must convert from floating point - rounding errors and other "
"issues may occur\. Please consider storing Decimal numbers as strings or "
"integers on this platform for lossless storage\.$",
SAWarning, r'^sqlalchemy\..*$')
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()
|