What you want to use here is self.assertRaises().