def test_close_disconnect_settings( self, cache_client: DefaultClient, settings: SettingsWrapper, mocker: MockerFixture, ): settings.DJANGO_REDIS_CLOSE_CONNECTION = True mock = mocker.patch.object(cache_client.connection_factory, "disconnect") cache_client.close() assert mock.called
def test_close(self, cache: RedisCache, settings: SettingsWrapper): settings.DJANGO_REDIS_CLOSE_CONNECTION = True cache.set("f", "1") cache.close()