Exemplo n.º 1
0
    def testPangrams(self):
        """
		Tests the tag for pulling pangrams
		"""
        languages = PANGRAMS.keys()
        for language in languages:
            t = "{% load greeking_tags %}{% pangram " + language + " %}"
            ctx, out = self.render(t)
            match = get_pangram_html(get_pangram(language))
            self.assertEqual(out, smart_unicode(match))
Exemplo n.º 2
0
 def testPangrams(self):
     """
     Tests the tag for pulling pangrams
     """
     from greeking.pangrams import PANGRAMS
     languages = list(PANGRAMS.keys())
     for language in languages:
         t = "{% load greeking_tags %}{% pangram " + language + " %}"
         self.render(t)
     self.assertRaises(
         TemplateSyntaxError,
         self.render,
         "{% load greeking_tags %}{% pangram foobar %}"
     )
     self.assertRaises(
         TemplateSyntaxError,
         self.render,
         "{% load greeking_tags %}{% pangram en foobar %}"
     )
     self.render("{% load greeking_tags %}{% pangram %}")