def assertRaises(self, excClass, callableObj=None, *args, **kwargs):
        if callableObj is None:
            return _AssertRaisesContext(excClass, self)
        try:
            callableObj(*args, **kwargs)
        except excClass:
            return

        if hasattr(excClass,'__name__'):
            excName = excClass.__name__
        else:
            excName = str(excClass)
        raise self.failureException("%s not raised" % excName)
Fail unless an exception of class excClass is thrown
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.3/django/utils/unittest/case.py/TestCase.assertRaises