Ñò
5	³Lc           @   s  d  d k  Z  d  d k l Z l Z l Z d  d k l Z d  d k l Z e d ƒ y d  d k	 Z	 Wn e
 j
 o d Z	 n Xy d  d k Z Wn e
 j
 o d Z n Xy d  d k Z Wn e
 j
 o d Z n Xd e i f d „  ƒ  YZ e d j o e i ƒ  n d S(	   iÿÿÿÿN(   t   Templatet   Contextt   add_to_builtins(   t   unittest(   t   escapes)   django.contrib.markup.templatetags.markupt	   Templatesc           B   s¼   e  Z d  Z d Z d Z e i e d ƒ d „  ƒ Z e i	 e d ƒ d „  ƒ Z
 e i e d ƒ d „  ƒ Z e i	 e d	 ƒ d
 „  ƒ Z e i e d ƒ d „  ƒ Z e i	 e d ƒ d „  ƒ Z RS(   s1   Paragraph 1

Paragraph 2 with "quotes" and @code@s   Paragraph 1

## An h2sH   Paragraph 1

Paragraph 2 with a link_

.. _link: http://www.example.com/s   texttile not installedc         C   sQ   t  d ƒ } | i t h |  i d 6ƒ ƒ i ƒ  } |  i | i d d ƒ d ƒ d  S(   Ns   {{ textile_content|textile }}t   textile_contents   	t    sV   <p>Paragraph 1</p>

<p>Paragraph 2 with &#8220;quotes&#8221; and <code>code</code></p>(   R    t   renderR   R   t   stript   assertEqualt   replace(   t   selft   tt   rendered(    (    sE   /usr/local/lib/python2.6/dist-packages/django/contrib/markup/tests.pyt   test_textile*   s    %s   texttile is installedc         C   sN   t  d ƒ } | i t h |  i d 6ƒ ƒ i ƒ  } |  i | t |  i ƒ ƒ d  S(   Ns   {{ textile_content|textile }}R   (   R    R   R   R   R	   R
   R   (   R   R   R   (    (    sE   /usr/local/lib/python2.6/dist-packages/django/contrib/markup/tests.pyt   test_no_textile2   s    %s   markdown not installedc         C   sZ   t  d ƒ } | i t h |  i d 6ƒ ƒ i ƒ  } t i d ƒ } |  i | i | ƒ ƒ d  S(   Ns   {{ markdown_content|markdown }}t   markdown_contents)   <p>Paragraph 1\s*</p>\s*<h2>\s*An h2</h2>(	   R    R   R   R   R	   t   ret   compilet
   assertTruet   match(   R   R   R   t   pattern(    (    sE   /usr/local/lib/python2.6/dist-packages/django/contrib/markup/tests.pyt   test_markdown8   s    %s   markdown is installedc         C   sH   t  d ƒ } | i t h |  i d 6ƒ ƒ i ƒ  } |  i | |  i ƒ d  S(   Ns   {{ markdown_content|markdown }}R   (   R    R   R   R   R	   R
   (   R   R   R   (    (    sE   /usr/local/lib/python2.6/dist-packages/django/contrib/markup/tests.pyt   test_no_markdown?   s    %s   docutils not installedc         C   sq   t  d ƒ } | i t h |  i d 6ƒ ƒ i ƒ  } y |  i | d ƒ Wn% t j
 o } |  i | d ƒ n Xd  S(   Ns#   {{ rest_content|restructuredtext }}t   rest_contentsi   <p>Paragraph 1</p>
<p>Paragraph 2 with a <a class="reference" href="http://www.example.com/">link</a></p>sr   <p>Paragraph 1</p>
<p>Paragraph 2 with a <a class="reference external" href="http://www.example.com/">link</a></p>(   R    R   R   R   R	   R
   t   AssertionError(   R   R   R   t   e(    (    sE   /usr/local/lib/python2.6/dist-packages/django/contrib/markup/tests.pyt   test_docutilsE   s    %		s   docutils is installedc         C   sH   t  d ƒ } | i t h |  i d 6ƒ ƒ i ƒ  } |  i | |  i ƒ d  S(   Ns#   {{ rest_content|restructuredtext }}R   (   R    R   R   R   R	   R
   (   R   R   R   (    (    sE   /usr/local/lib/python2.6/dist-packages/django/contrib/markup/tests.pyt   test_no_docutilsS   s    %(   t   __name__t
   __module__R   R   R   R   t
   skipUnlesst   textileR   t   skipIfR   t   markdownR   R   t   docutilsR   R   (    (    (    sE   /usr/local/lib/python2.6/dist-packages/django/contrib/markup/tests.pyR      s   t   __main__(   R   t   django.templateR    R   R   t   django.utilsR   t   django.utils.htmlR   R!   t   ImportErrort   NoneR#   R$   t   TestCaseR   R   t   main(    (    (    sE   /usr/local/lib/python2.6/dist-packages/django/contrib/markup/tests.pyt   <module>   s&   
A