[1.7.x] Silenced a Python 2 ImportWarning in a migrations test.

Backport of 66211b4b75 from master