'Testing utility asserting that text1 appears before text2 in response
content.'

def assertContentBefore(self, response, text1, text2, failing_msg=None):

    self.assertEqual(response.status_code, 200)
    self.assertLess(response.content.index(force_bytes(text1)), response.content.index(force_bytes(text2)), (((failing_msg or '') + '\nResponse:\n') + response.content.decode(response.charset)))
