Don't use assertIn for 2.6 compatibility
Check for type and constraint in one go
Use assertEqual