Show
Ignore:
Timestamp:
09/16/08 13:31:56 (18 months ago)
Author:
JensDiemer
Message:
  • add a pass-through for normal django tags (not blocktags)
  • Move creole markup above
  • Update creole markup help and unittests
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/pylucid_project/tests/markup_creole.py

    r1766 r1769  
    8484    #-------------------------------------------------------------------------- 
    8585 
    86     def test_creole_basic1(self): 
     86    def test_creole_basic(self): 
    8787        out_string = self._parse("a text line.") 
    8888        self.assertEqual(out_string, "<p>a text line.</p>\n") 
    8989 
    90     def test_creole_basic2(self): 
     90    def test_creole_linebreak(self): 
    9191        self.assertCreole(r""" 
    9292            Force\\linebreak 
     
    9696        """) 
    9797 
    98     def test_creole_basic3(self): 
    99         self.assertCreole(r""" 
    100             Here is [[a internal]] link. 
    101             This is [[http://domain.tld|external links]]. 
    102             A [[internal links|different]] link name. 
    103         """, """ 
    104             <p>Here is <a href="a internal">a internal</a> link.<br /> 
    105             This is <a href="http://domain.tld">external links</a>.<br /> 
    106             A <a href="internal links">different</a> link name.</p> 
    107         """) 
     98    def test_bold_italics(self): 
     99        self.assertCreole(r""" 
     100            **//bold italics//** 
     101            //**bold italics**// 
     102            //This is **also** good.// 
     103        """, """ 
     104            <p><strong><i>bold italics</i></strong><br /> 
     105            <i><strong>bold italics</strong></i><br /> 
     106            <i>This is <strong>also</strong> good.</i></p> 
     107        """) 
     108 
     109    def test_internal_links(self): 
     110        self.assertCreole(r""" 
     111            A [[internal]] link... 
     112            ...and [[/a internal]] link. 
     113        """, """ 
     114            <p>A <a href="internal">internal</a> link...<br /> 
     115            ...and <a href="/a internal">/a internal</a> link.</p> 
     116        """) 
     117         
     118    def test_external_links(self): 
     119        self.assertCreole(r""" 
     120            With pipe separator: 
     121            1 [[internal links|link A]] test. 
     122            2 [[http://domain.tld|link B]] test. 
     123        """, """ 
     124            <p>With pipe separator:<br /> 
     125            1 <a href="internal links">link A</a> test.<br /> 
     126            2 <a href="http://domain.tld">link B</a> test.</p> 
     127        """) 
     128 
     129    def test_bolditalic_links(self): 
     130        self.assertCreole(r""" 
     131            //[[a internal]]// 
     132            **[[Shortcut2|a page2]]** 
     133            //**[[Shortcut3|a page3]]**// 
     134        """, """ 
     135            <p><i><a href="a internal">a internal</a></i><br /> 
     136            <strong><a href="Shortcut2">a page2</a></strong><br /> 
     137            <i><strong><a href="Shortcut3">a page3</a></strong></i></p> 
     138        """) 
     139             
     140 
    108141 
    109142    def test_django1(self): 
     
    170203                if (x[i] &gt; 0) { 
    171204                  x[i]--; 
    172               }}} 
     205              &#x7D;&#x7D;} 
    173206            </pre> 
    174207        """) 
     
    217250            <a href="Link">Link</a><br /> 
    218251            [[Link]]</p> 
    219         """) 
    220  
    221     def test_bold_italics(self): 
    222         self.assertCreole(r""" 
    223             **//bold italics//** 
    224             //**bold italics**// 
    225             //This is **also** good.// 
    226              
    227             //[[a page|this is italic]]// 
    228             **[[a page]]** 
    229             //**[[a page]]**// 
    230         """, """ 
    231             <p><strong><i>bold italics</i></strong><br /> 
    232             <i><strong>bold italics</strong></i><br /> 
    233             <i>This is <strong>also</strong> good.</i></p> 
    234              
    235             <p><i><a href="a page">this is italic</a></i><br /> 
    236             <strong><a href="a page">a page</a></strong><br /> 
    237             <i><strong><a href="a page">a page</a></strong></i></p> 
    238252        """) 
    239253