Add test for issue 7181.

Although it doesn't solve the transform, it is not crashing now.
This is a foo == foo test. You might as well just write `!= None  # doesn't fail`.