def test_stale_disabled(self):
        """Test whether no stale version of the data from the cache is used
        when disabled, and if a warning is issued to the user."""
        pydov.cache.stale_on_error = False

        bs = BoringSearch(objecttype=pydov.types.boring.Boring)

        testdata_path = os.path.join(
            'tests', 'data', 'types', 'boring', 'boring.xml')

        cache_path = os.path.join(
            pydov.cache.cachedir, 'boring', '2004-103984.xml.gz'
        )
        os.makedirs(os.path.dirname(cache_path))

        with open(testdata_path, 'r') as testdata:
            with gzip.open(cache_path, 'wb') as cached_data:
                cached_data.write(testdata.read().encode('utf8'))
        time.sleep(0.5)

        with pytest.warns(XmlFetchWarning):
            df = bs.search(query=PropertyIsEqualTo(
                'pkey_boring', build_dov_url('data/boring/2004-103984')))

        assert np.isnan(df.iloc[0].boorgatmeting)
        assert np.isnan(df.iloc[0].boormethode)