Remove repeated code from Static Pages tests