ó
P'—^c           @   sP   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ÿÿÿÿ(   t   reverse(   t   TestCaset   override_settings(   t   DRFSettingst   DRFDocsViewTestsc           B   sQ   e  Z i e d  6Z d „  Z d „  Z d „  Z d „  Z e d e ƒ d „  ƒ Z	 RS(   t	   HIDE_DOCSc         C   s   t  t |  ƒ j ƒ  d  S(   N(   t   superR   t   setUp(   t   self(    (    s-   /tmp/pip-unpacked-wheel-lCfRX8/tests/tests.pyR      s    c         C   s?   t  ƒ  } |  j | j d ƒ t ƒ |  j | j d ƒ d  ƒ d  S(   NR   t   TEST(   R   t   assertEqualt   get_settingt   Falset   None(   R   t   settings(    (    s-   /tmp/pip-unpacked-wheel-lCfRX8/tests/tests.pyt   test_settings_module   s    	c         C   sF  |  j  j t d ƒ ƒ } |  j | j d ƒ |  j t | j d ƒ d ƒ |  j | j d d j d ƒ |  j | j d d j d d g ƒ |  j | j d d j	 d	 ƒ |  j | j d d j
 d
 ƒ |  j t | j d d j ƒ d ƒ |  j | j d d j d d d ƒ |  j | j d d j d d ƒ |  j | j d d j d ƒ |  j | j d d j d d g ƒ |  j | j d d j	 d ƒ |  j | j d d j
 d ƒ |  j t | j d d j ƒ d ƒ |  j | j d d j d d d ƒ |  j | j d d j d d ƒ |  j t | j d d j ƒ d ƒ d S(   sš   
        Should load the drf focs view with all the endpoints.
        NOTE: Views that do **not** inherit from DRF's "APIView" are not included.
        t   drfdocsiÈ   t	   endpointsi   i    t   accountst   POSTt   OPTIONSs   /accounts/login/sH   A view that allows users to login providing their username and password.i   t   typet	   CharFieldt   requiredi   s   /accounts/login2/sa   A view that allows users to login providing their username and password. Without serializer_classi	   s   'test_value'N(   t   clientt   getR    R
   t   status_codet   lent   contextt   name_parentt   allowed_methodst   patht	   docstringt   fieldst
   assertTruet   strt   errors(   R   t   response(    (    s-   /tmp/pip-unpacked-wheel-lCfRX8/tests/tests.pyt   test_index_view_with_endpoints   s$    $$&#$$&#c         C   s’   |  j  j d t d ƒ ƒ } |  j | j d ƒ |  j t | j d ƒ d ƒ |  j | j d d j d ƒ |  j t | j d d j ƒ d ƒ d  S(	   Ns   %s?search=reset-passwordR   iÈ   R   i   i   s!   /accounts/reset-password/confirm/i   (	   R   R   R    R
   R   R   R   R   R!   (   R   R%   (    (    s-   /tmp/pip-unpacked-wheel-lCfRX8/tests/tests.pyt    test_index_search_with_endpoints4   s
    t   REST_FRAMEWORK_DOCSc         C   sH   |  j  j t d ƒ ƒ } |  j | j d ƒ |  j | j j ƒ  d ƒ d S(   s{   
        Should prevent the docs from loading the "HIDE_DOCS" is set
        to "True" or undefined under settings
        R   i”  s	   NOT FOUNDN(   R   R   R    R
   R   t   reason_phraset   upper(   R   R%   (    (    s-   /tmp/pip-unpacked-wheel-lCfRX8/tests/tests.pyt   test_index_view_docs_hidden<   s    (
   t   __name__t
   __module__t   Truet   SETTINGS_HIDE_DOCSR   R   R&   R'   R   R+   (    (    (    s-   /tmp/pip-unpacked-wheel-lCfRX8/tests/tests.pyR      s   
				N(   t   django.core.urlresolversR    t   django.testR   R   t   rest_framework_docs.settingsR   R   (    (    (    s-   /tmp/pip-unpacked-wheel-lCfRX8/tests/tests.pyt   <module>   s   