예제 #1
0
 def test_complicated_shortcode(self):
     text = '<p style="text-align: center;">[youtube VNmliVqLKeg 560 340]</p>'
     out = parse_shortcodes.parse(text)
     self.assertEquals(
         out,
         '<p style="text-align: center;"><iframe width="560" height="315" src="http://www.youtube.com/embed/VNmliVqLKeg?feature=oembed" frameborder="0" allowfullscreen></iframe></p>'
     )
예제 #2
0
 def test_caption_shortcode_with_unicode(self):
     text = 'blah \u2603 blah [caption id="attachment_68" align="alignnone" width="900" caption="Caption goes here! \u2603"]<img />[/caption]'
     out = parse_shortcodes.parse(text)
     self.assertEquals(
         out,
         'blah \u2603 blah <div id="attachment_68" class=\'wp-caption\' align="alignnone" style="width: \'910px\'"><img /><p class=\'wp-caption-text\'>Caption goes here! \u2603</p></div>'
     )
예제 #3
0
 def test_invalid_shortcode(self):
     text = "blah blah [somethingelse monkeypoo]"
     out = parse_shortcodes.parse(text)
     self.assertEquals(out, 'blah blah [somethingelse monkeypoo]')
예제 #4
0
 def test_invalid_youtube_shortcode(self):
     text = "blah blah [youtube monkeypoo]"
     out = parse_shortcodes.parse(text)
     self.assertEquals(text, 'blah blah [youtube monkeypoo]')
예제 #5
0
 def test_really_empty_youtube_shortcode(self):
     text = "blah blah [youtube]"
     out = parse_shortcodes.parse(text)
     self.assertEquals(text, 'blah blah [youtube]')
예제 #6
0
 def test_complicated_shortcode(self):
     text = '<p style="text-align: center;">[youtube VNmliVqLKeg 560 340]</p>'
     out = parse_shortcodes.parse(text)
     self.assertEquals(out,'<p style="text-align: center;"><iframe width="560" height="315" src="http://www.youtube.com/embed/VNmliVqLKeg?feature=oembed" frameborder="0" allowfullscreen></iframe></p>')
예제 #7
0
 def test_simple_shortcode(self):
     text = "asdihasdf fioasdi [youtube oHg5SJYRHA0]"
     out = parse_shortcodes.parse(text)
     assert (
         '<iframe width="800" height="600" src="http://www.youtube.com/embed/oHg5SJYRHA0?feature=oembed" frameborder="0" allowfullscreen></iframe>'
         in out)
예제 #8
0
 def test_invalid_shortcode(self):
     text = "blah blah [somethingelse monkeypoo]"
     out = parse_shortcodes.parse(text)
     self.assertEquals(out,'blah blah [somethingelse monkeypoo]')
예제 #9
0
 def test_caption_shortcode_with_unicode(self):
     text = 'blah \u2603 blah [caption id="attachment_68" align="alignnone" width="900" caption="Caption goes here! \u2603"]<img />[/caption]'
     out = parse_shortcodes.parse(text)
     self.assertEquals(out,'blah \u2603 blah <div id="attachment_68" class=\'wp-caption\' align="alignnone" style="width: \'910px\'"><img /><p class=\'wp-caption-text\'>Caption goes here! \u2603</p></div>')
예제 #10
0
 def test_really_empty_youtube_shortcode(self):
     text = "blah blah [youtube]"
     out = parse_shortcodes.parse(text)
     self.assertEquals(text,'blah blah [youtube]')
예제 #11
0
 def test_invalid_youtube_shortcode(self):
     text = "blah blah [youtube monkeypoo]"
     out = parse_shortcodes.parse(text)
     self.assertEquals(text,'blah blah [youtube monkeypoo]')
예제 #12
0
 def test_simple_shortcode(self):
     text = "asdihasdf fioasdi [youtube oHg5SJYRHA0]"
     out = parse_shortcodes.parse(text)
     assert('<iframe width="800" height="600" src="http://www.youtube.com/embed/oHg5SJYRHA0?feature=oembed" frameborder="0" allowfullscreen></iframe>' in out)