Midterm elections are commonly viewed as a test of the political environment facing the party in power.