I think it is better to use assertTrue/assertFalse here: 
`self.assertFalse(any(hasattr(e._root, 'getparent') for e in div_class))`