'Assert that a root element, when flattened, is equal to a string.'

def assertFlattensTo(self, root, target):

    d = flattenString(None, root)
    d.addCallback((lambda s: self.assertEqual(s, target)))
    return d
