def assert_studio_view(block, fragment):
 try:
  html = lxml.html.fragment_fromstring(fragment.content)
 except lxml.etree.ParserError:
  assert_studio_view_invalid_html(block, fragment.content)
 else:
  assert_studio_view_valid_html(block, html)

def assert_studio_view ( block , fragment ) : try : html = lxml . html . fragment_fromstring ( fragment . content ) except lxml . etree . ParserError : assert_studio_view_invalid_html ( block , fragment . content ) else : assert_studio_view_valid_html ( block , html )
helper function to assert that the fragment is valid output the specified blocks studio_view .