def setUp(self): super(TestSQLAlchemyMiddleware, self).setUp() self.middleware = middleware.SQLAlchemyMiddleware(get_response) self.orig_dbs = databases.copy() databases.clear() databases.update(one=mock.MagicMock(spec=SQLAlchemy), two=mock.MagicMock(spec=SQLAlchemy))
def test_update(self): databases = dbdict() databases.update({"one": SQLAlchemy("sqlite://")}, two=SQLAlchemy("sqlite://"))
def tearDown(self): super(TestSQLAlchemyMiddleware, self).setUp() databases.clear() databases.update(self.orig_dbs)
def tearDown(self): super().setUp() databases.clear() databases.update(self.orig_dbs)