'Assert that the exception raised by a broken context factory\'s
C{getContext} method is raised by some reactor method.  If it is not, an
exception will be raised to fail the test.
@param useIt: A two-argument callable which will be called with a
reactor and a broken context factory and which is expected to raise
the same exception as the broken context factory\'s C{getContext}
method.'

def _testBadContext(self, useIt):

    reactor = self.buildReactor()
    exc = self.assertRaises(ValueError, useIt, reactor, BrokenContextFactory())
    self.assertEqual(BrokenContextFactory.message, str(exc))
