Making the create_random_gradient function render a test gradient only in test mode