You could replace this outdated pattern with:

    with self.assertRaises(ValueError):
        # ...

while you're there.