def assertFlatteningRaises(self, root, exn):
        d = self.assertFailure(self.assertFlattensTo(root, b''), FlattenerError)
        d.addCallback(lambda exc: self.assertIsInstance(exc._exception, exn))
        return d
Assert flattening a root element raises a particular exception.
dataset/ETHPy150Open twisted/twisted/twisted/web/test/_util.py/FlattenTestCase.assertFlatteningRaises