Added cache to available_apps in cache tests
Fixed #20289 -- pickling of dynamic models