The influence of galaxy formation physics on weak lensing tests of general relativity