def assertContainsAll(haystack, needles, test_case):
 for needle in reversed(needles):
  if (needle in haystack):
   needles.remove(needle)
 if needles:
  test_case.fail('{haystack} did not contain {needles}'.format(haystack=haystack, needles=needles))

def assertContainsAll ( haystack , needles , test_case ) : for needle in reversed ( needles ) : if ( needle in haystack ) : needles . remove ( needle ) if needles : test_case . fail ( '{haystack} did not contain {needles}' . format ( haystack = haystack , needles = needles ) )
assert that all the terms in the needles list are found in the haystack .