'Proves that the expectation string is a reasonable one, since it is
not very human readable with all of the escaping.
Ensures that after unescaping (html) the string can be parsed to a
(nearly) equivalent dict.
Assertions will fail if the expectation is invalid.
Arguments:
test_dict: The original dict to be tested in the Mako template.
expected_json_for_html_string: An html escaped json string that
should be parseable into a near equivalent to test_dict.'

def _validate_expectation_of_json_for_html(self, test_dict, expected_json_for_html_string):

    html_parser = HTMLParser.HTMLParser()
    expected_json = html_parser.unescape(expected_json_for_html_string)
    parsed_expected_dict = json.loads(expected_json)
    parsed_expected_dict['test_tuple'] = tuple(parsed_expected_dict['test_tuple'])
    self.assertEqual(test_dict['test_string'].decode(encoding='utf-8'), parsed_expected_dict['test_string'])
    self.assertEqual(test_dict['test_tuple'], parsed_expected_dict['test_tuple'])
    self.assertEqual(test_dict['test_number'], parsed_expected_dict['test_number'])
    self.assertEqual(test_dict['test_bool'], parsed_expected_dict['test_bool'])
