def test_category_no_tpl(self):
     content = Article(content=u'', metadata={u'category': u'misc'})
     category_template(self.generator, content)
     self.assertEqual(content.template, 'article')
 def test_category_with_tpl(self):
     content = Article(content=u'', metadata={u'category': u'misc'})
     with open('article-misc.html', 'w') as fd: fd.write('foobar')
     category_template(self.generator, content)
     self.assertEqual(content.template, 'article-misc')
     os.remove('article-misc.html')
 def test_no_category(self):
     content = Article(content=u'', metadata={})
     category_template(self.generator, content)
     self.assertEqual(content.template, 'article')