import unittest from simple_footnotes import parse_for_footnotes class PseudoArticleGenerator(object): articles = [] class PseudoArticle(object): _content = "" slug = "article" class TestFootnotes(unittest.TestCase): def _expect(self, input, expected_output): ag = PseudoArticleGenerator() art = PseudoArticle() art._content = input ag.articles = [art] parse_for_footnotes(ag) self.assertEqual(art._content, expected_output) def test_simple(self): self._expect("words[ref]footnote[/ref]end", ('words1end' '
this is code[ref]footnote[/ref] end code
end",
"wordsthis is code[ref]footnote[/ref] end code
end")
if __name__ == '__main__':
unittest.main()