def METHOD_NAME(self):
    txs = [self._get_new_tx(nonce) for nonce in range(CACHE_SIZE)]
    for tx in txs:
        self.cache_storage.save_transaction(tx)
    for tx in txs:
        self.assertIn(tx.hash, self.cache_storage.dirty_txs)
    # Flush deferred is not None
    self.assertIsNotNone(self.cache_storage.flush_deferred)
    last_flush_deferred = self.cache_storage.flush_deferred
    self.cache_storage._start_flush_thread()
    self.assertEqual(last_flush_deferred, self.cache_storage.flush_deferred)
    # We flush the cache and flush_deferred becomes None
    self.cache_storage._cb_flush_thread(self.cache_storage.dirty_txs.copy())
    self.assertIsNone(self.cache_storage.flush_deferred)
    # After the interval it becomes not None again
    self.clock.advance(10)
    self.assertIsNotNone(self.cache_storage.flush_deferred)
    # If an err occurs, it will become None again and then not None after the interval
    self.cache_storage._err_flush_thread('')
    self.assertIsNone(self.cache_storage.flush_deferred)
    self.clock.advance(5)
    self.assertIsNotNone(self.cache_storage.flush_deferred)
    # Remove element from cache to test a part of the code
    del self.cache_storage.cache[next(iter(self.cache_storage.dirty_txs))]
    self.cache_storage._flush_to_storage(self.cache_storage.dirty_txs.copy())