def validate_fragment(self, fragment=None, fragment_dict=None):
fragment_dict = fragment_dict if fragment_dict else fragment.to_dict()<EOL>assert fragment_dict['<STR_LIT:content>'] == TEST_HTML<EOL>assert fragment_dict['<STR_LIT>'] == TEST_JS_INIT_FN<EOL>assert fragment_dict['<STR_LIT>'] == EXPECTED_JS_INIT_VERSION<EOL>assert fragment_dict['<STR_LIT>'] == TEST_JSON_INIT_ARGS<EOL>assert fragment_dict['<STR_LIT>'] == EXPECTED_RESOURCES<EOL>
Validates that the fields of a fragment are all correct.