Fixed conditional skipping of test for left/right lookup types.

connection.ops.spatial_version is None for some backends (eg. MySQL) and
the comparison fails on Python 3 with TypeError.