self.assertEqual(result,'''<h1>hi</h1> this is my template\ntest<bfe_non_existing_element must disappear/><test_1 non prefixed element must stay as any normal tag/>tfrgarbage\n<br/>test me!<b>ok</b>a default valueeditor\n<br/>test me!<b>ok</b>a default valueeditor\n<br/>test me!<b>ok</b>a default valueeditor\n''')
self.assertEqual(needs_2nd_pass,False)
deftest_empty_formatting(self):
"""bibformat - formatting empty record"""
result=bibformat_engine.format_record(recID=0,
of='hb',
verbose=9,
xml_record=self.empty_record_xml)
self.assertEqual(result,('',False))
# FIXME: The commented test below currently fails, since xm
# format is generated from the database
# result = bibformat_engine.format_record(recID=0,
# of='xm',
# verbose=9,
# xml_record=self.empty_record_xml)
# self.assertEqual(result, self.empty_record_xml)
deftest_format_with_format_template(self):
""" bibformat - correct formatting with given template"""
self.assertEqual(result,'''<h1>hi</h1> this is my template\ntest<bfe_non_existing_element must disappear/><test_1 non prefixed element must stay as any normal tag/>tfrgarbage\n<br/>test me!<b>ok</b>a default valueeditor\n<br/>test me!<b>ok</b>a default valueeditor\n<br/>test me!<b>ok</b>a default valueeditor\n99999''')