refactored tests that use assertRaises to be compatible with python 2.6/3.2