Why not use a `Mock` object here with `is_preview_enabled` set to `lambda: True`?  I'd also suggest putting the mock runtime setup code in a helper function so it doesn't distract from the test logic.