Update remaining tests to get rid of .query
This commit is contained in:
@@ -711,8 +711,8 @@ def test_PrecisionFilter_error(mocker, whitelist_conf) -> None:
|
||||
|
||||
def test_PerformanceFilter_error(mocker, whitelist_conf, caplog) -> None:
|
||||
whitelist_conf['pairlists'] = [{"method": "StaticPairList"}, {"method": "PerformanceFilter"}]
|
||||
if hasattr(Trade, 'query'):
|
||||
del Trade.query
|
||||
if hasattr(Trade, 'session'):
|
||||
del Trade.session
|
||||
mocker.patch(f'{EXMS}.exchange_has', MagicMock(return_value=True))
|
||||
exchange = get_patched_exchange(mocker, whitelist_conf)
|
||||
pm = PairListManager(exchange, whitelist_conf, MagicMock())
|
||||
|
@@ -107,7 +107,7 @@ def test_PairLocks_getlongestlock(use_db):
|
||||
# No lock should be present
|
||||
PairLocks.use_db = use_db
|
||||
if use_db:
|
||||
assert len(PairLock.query.all()) == 0
|
||||
assert len(PairLock.get_all_locks().all()) == 0
|
||||
|
||||
assert PairLocks.use_db == use_db
|
||||
|
||||
@@ -139,7 +139,7 @@ def test_PairLocks_reason(use_db):
|
||||
PairLocks.use_db = use_db
|
||||
# No lock should be present
|
||||
if use_db:
|
||||
assert len(PairLock.query.all()) == 0
|
||||
assert len(PairLock.get_all_locks().all()) == 0
|
||||
|
||||
assert PairLocks.use_db == use_db
|
||||
|
||||
|
Reference in New Issue
Block a user