ó
¹9—^c           @   s\   d  d l  Z  d  d l m Z d  d l m Z m Z d  d l m Z d e f d „  ƒ  YZ d S(   iÿÿÿÿN(   t   patch(   t   TestCaset   RequestFactory(   t   gzip_compressort   TestCompressorc           B   sM   e  Z d  „  Z d „  Z e d ƒ d „  ƒ Z e d ƒ d „  ƒ Z d „  Z RS(   c         C   s   t  ƒ  |  _ d  S(   N(   R   t   factory(   t   self(    (    s?   /tmp/pip-unpacked-wheel-51oq52/tinymce/tests/test_compressor.pyt   setUp   s    c         C   sY   |  j  j d ƒ } t | ƒ } |  j d | j ƒ |  j d | d ƒ |  j | d ƒ d  S(   Ns   /tinymce/compressor/iÈ   s   text/javascripts   Content-Typet
   tinyMCE_GZ(   R   t   getR   t   assertEqualt   status_codet   assertContains(   R   t   requestt   response(    (    s?   /tmp/pip-unpacked-wheel-51oq52/tinymce/tests/test_compressor.pyt   test_not_js   s
    s   tinymce.compressor.cache.getc         C   s§   i d d 6| _  |  j j d i d d 6ƒ } d | j d <t | ƒ } |  j d | j ƒ |  j d | d	 ƒ |  j d
 | d ƒ |  j d | j ƒ |  j | j	 ƒ d  S(   Nt   testt   ETags   /tinymce/compressor/t   truet   jst   HTTP_IF_NONE_MATCHi0  t   0s   Content-Lengths   text/javascripts   Content-Typet    (
   t   return_valueR   R	   t   METAR   R
   R   t   contentt
   assertTruet   called_once(   R   t
   cache_mockR   R   (    (    s?   /tmp/pip-unpacked-wheel-51oq52/tinymce/tests/test_compressor.pyt   test_cache_data_etag   s    c         C   s§   i d d 6| _  |  j j d i d d 6ƒ } d | j d <t | ƒ } |  j d | j ƒ |  j d | d	 ƒ |  j d
 | d ƒ |  j d | j ƒ |  j | j	 ƒ d  S(   NR   s   Last-Modifieds   /tinymce/compressor/R   R   t   HTTP_IF_MODIFIED_SINCEi0  R   s   Content-Lengths   text/javascripts   Content-TypeR   (
   R   R   R	   R   R   R
   R   R   R   R   (   R   R   R   R   (    (    s?   /tmp/pip-unpacked-wheel-51oq52/tinymce/tests/test_compressor.pyt   test_cache_data_last_modified)   s    c         C   s¯   |  j  j d i d d 6d d 6d d 6d d 6d	 d
 6ƒ } t | ƒ } t j | j d t j ƒ } |  j d | j ƒ |  j d | d ƒ |  j d | d ƒ |  j	 d | ƒ d  S(   Ns   /tinymce/compressor/R   R   t   compresst   ent	   languagest   examplet   pluginst   advancedt   themesi   iÈ   s   text/javascripts   Content-Typet   gzips   Content-Encodings   var tinyMCEPreInit(
   R   R	   R   t   zlibt
   decompressR   t	   MAX_WBITSR
   R   t   assertIn(   R   R   R   t   response_string(    (    s?   /tmp/pip-unpacked-wheel-51oq52/tinymce/tests/test_compressor.pyt   test_compressor:   s    (   t   __name__t
   __module__R   R   R    R   R   R-   (    (    (    s?   /tmp/pip-unpacked-wheel-51oq52/tinymce/tests/test_compressor.pyR      s
   		(	   R(   t   mockR    t   django.testR   R   t   tinymce.compressorR   R   (    (    (    s?   /tmp/pip-unpacked-wheel-51oq52/tinymce/tests/test_compressor.pyt   <module>   s   