예제 #1
0
    def test_delete_all(self):
        symbols = [
            {"symbol": "C6L.SI", "price_updated_at": None},
        ]

        prices = [
            {"symbol_obj": "C6L.SI", "date": datetime(2012, 12, 21), "open": 0, "close": 0, "high": 0, "low": 0, "volume": 0, "adj_close": 99.9},
        ]

        with db.transaction():
            Symbol.insert_many(symbols).execute()
            Price.insert_many(prices).execute()

        query.delete_all()

        self.assertEqual(list(Symbol.select()), [])
        self.assertEqual(list(Price.select()), [])
예제 #2
0
 def tearDown(self):
     query.delete_all()