Testing general relativity with the Doppler magnification effect