
    8 fe                       d Z ddlmZ ddlZddlZddlZddlZddlZddlZddl	m
Z
 ddlmZmZmZmZmZ ddlZddlmZ ddlmZmZmZmZmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0 dd	l1m2Z2m3Z3 erddl4Z4d
Z5dZ6dZ7 ej8                    dWd            Z9dZ:dZ;dZ<ej=        dXd            Z>dYdZ?dZdZ@	 d[d\d#ZA ejB        eeC                              ZD ej8                    d]d'            ZE ej8        d()          dZd*            ZF ej8                    d^d,            ZGd_d/ZHd`d2ZI ej8        d(3          dad6            ZJ ejK        d(d78          dbd;            ZL ejK        d7<          dcd>            ZM ejK        d(?          ddd@            ZN ejK        d(dA8          dedD            ZO ejK        d(?          dfdE            ZP ejK                    dgdI            ZQ ejK                    dhdM            ZR ejK                    dYdN            ZS ejK        d(?          dbdO            ZT ejK        d(d78          dP             ZU ejK        d(?          didQ            ZV ejK        d(?          dfdR            ZW G dS dT          ZX G dU dC          ZY ejB        eY                     ZZdjdVZ[dS )kzA pytest plugin which helps testing Django applications

This plugin handles creating and destroying the test environment and
test database and provides some useful text fixtures.
    )annotationsN)reduce)TYPE_CHECKINGContextManager	GeneratorListNoReturn   )is_django_unittest)_django_db_helper_live_server_helperadmin_client
admin_userasync_clientasync_rfclientdbdjango_assert_max_num_queriesdjango_assert_num_queries"django_capture_on_commit_callbacksdjango_db_createdbdjango_db_keepdbdjango_db_modify_db_settings,django_db_modify_db_settings_parallel_suffix'django_db_modify_db_settings_tox_suffix)django_db_modify_db_settings_xdist_suffixdjango_db_reset_sequencesdjango_db_serialized_rollbackdjango_db_setupdjango_db_use_migrationsdjango_user_modeldjango_username_fieldlive_serverrfsettingstransactional_dbvalidate_django_db)django_settings_is_configuredskip_if_no_djangoDJANGO_SETTINGS_MODULEDJANGO_CONFIGURATIONFAIL_INVALID_TEMPLATE_VARSparserpytest.ParserreturnNonec                   |                      d          }|                    ddddd           |                    ddd	dd
           |                    ddt          dd d           |                    ddt          dd d           |                    dddddd           |                    ddddd           |                     t          d           |                    dd d           |                     t
          d           |                     dd d!d"#           |                     d$d%d&'           |                    d(dd)dd*           |                     t          d*d!d#           d S )+Ndjangoz
--reuse-db
store_truereuse_dbFz^Re-use the testing database if it already exists, and do not remove it when the test finishes.)actiondestdefaulthelpz--create-db	create_dbzZRe-create the database, even if it exists. This option can be used to override --reuse-db.z--dsstoredszSet DJANGO_SETTINGS_MODULE.)r5   typer6   r7   r8   z--dcdczSet DJANGO_CONFIGURATION.z--nomigrationsz--no-migrationsnomigrationsz'Disable Django migrations on test setupz--migrationsstore_falsez&Enable Django migrations on test setupz4django-configurations class to use by pytest-django.z--liveserverz-Address and port for the live_server fixture.)r7   r8   z/Django settings module to use by pytest-django.django_find_projectz?Automatically find and add a Django project to the Python path.boolT)r<   r7   django_debug_modezRHow to set the Django DEBUG setting (default `False`). Use `keep` to not override.False)r7   z--fail-on-template-varsitvz(Fail for invalid variables in templates.)getgroup	addoptionstraddiniCONFIGURATION_ENVSETTINGS_MODULE_ENVINVALID_TEMPLATE_VARS_ENV)r-   groups     J/var/www/equiseq/venv/lib/python3.11/site-packages/pytest_django/plugin.pypytest_addoptionrN   A   s6   OOH%%E	OO7     
OO5     
OO*     
OO(     
OO6     
OO5     MM>   
OO<    
 MM9  
 MML	     MM_    
 
OO!7     MM!2	          zpytest-django found a Django project in %s (it contains manage.py) and added it to the Python path.
If this is wrong, add "django_find_project = false" to pytest.ini and explicitly manage your Python path.zpytest-django could not find a Django project (no manage.py file could be found). You must explicitly add your Django project to the Python path to have it picked up.zzpytest-django did not search for Django projects since it is disabled in the configuration ("django_find_project = false")extra_messagerG   Generator[None, None, None]c              #     K   	 d V  d S # t           $ r3}|j        r|j        d         dz   nd}|| z   }t          |          d d }~ww xY w)Nr   z

 )ImportErrorargs)rP   e
django_msgmsgs       rM   _handle_import_errorrY      sm      ) ) ) )-.V;afQi&((
=(#D()s   
 
A.AAc                    dddddfd
} ||           }|rIt           j                            dt          |                                                     t
          |z  S t          S )Npathpathlib.Pathr/   rA   c                |    	 |                                  o| dz                                  S # t          $ r Y dS w xY w)Nz	manage.pyF)is_direxistsOSError)r[   s    rM   is_django_projectz6_add_django_project_to_path.<locals>.is_django_project   sM    	;;==Bd[&8%@%@%B%BB 	 	 	55	s   *- 
;;argrG   c                b    |                      dd          d         } t          j        |           S )Nz::r
   r   )splitpathlibPath)rb   s    rM   arg_to_pathz0_add_django_project_to_path.<locals>.arg_to_path   s*    iia  #|C   rO   pathlib.Path | Nonec                8   d | D             }fd|D             }t           j                                        }|s|                    |           n||vr|                    |           |D ],} |          r|c S |j        D ]} |          r|c c S -d S )Nc              3  4   K   | ]}t          |          V  d S N)rG   ).0rb   s     rM   	<genexpr>zH_add_django_project_to_path.<locals>.find_django_path.<locals>.<genexpr>   s(      --CHH------rO   c                P    g | ]"}|                     d            |          #S )-)
startswith)rl   xrg   s     rM   
<listcomp>zI_add_django_project_to_path.<locals>.find_django_path.<locals>.<listcomp>   s2    OOOQ\\#=N=NO[[^^OOOrO   )re   rf   cwdappendparents)rU   str_args	path_argsrs   rb   parentrg   ra   s         rM   find_django_pathz5_add_django_project_to_path.<locals>.find_django_path   s    -----OOOOXOOO	l   	"S!!!!	!!S!!! 	" 	"C  %% 


+ " "$$V,, "!MMMMM"" trO   r   )r[   r\   r/   rA   )rb   rG   r/   r\   )r/   rh   )sysr[   insertrG   absolutePROJECT_FOUNDPROJECT_NOT_FOUND)rU   ry   project_dirrg   ra   s      @@rM   _add_django_project_to_pathr      s       ! ! ! !
      $ #"4((K +3{335566777{**rO   configpytest.Configc                    dt           j        vrd S dd l}|j        j        j        sd S dd l}|j        j        j        s |j	                     | j
        t                   }|                                 d S )Nr2   r   )rz   modulesdjango.confconfr%   
configureddjango.appsappsreadysetupstashblocking_manager_keyblock)r   r2   blocking_managers      rM   _setup_djangor      s    s{"" ;* ;! |$89rO   rq   None | (bool | str)namer7   bool | NonerA   c           	        | t          |          S t          | t                     r| S ddddd}	 ||                                          S # t          $ r/ d                    |          }t          |  d| d| d          d w xY w)NTF)truefalse10, z is not a valid value for z. It must be one of .)rA   
isinstancelowerKeyErrorjoin
ValueError)rq   r   r7   possible_valuespossibles        rM   _get_boolean_valuer      s    
 	yG}}!T #e$UKKOqwwyy))   99_--QQDQQhQQQ
 
	s   A 9Bearly_configrU   	list[str]c                z                          dd                                 dd                                 dd           |                    |          }|j        s|j        rd S t	                               d          d          }|rt          |          }nt          }|j        sQt	          t          j
                            t                    t                    s                     t                    rdt          j
        t          <   d fd} ||j        t                    \  }} ||j        t                     \  }	}
g }| j        t$          <   |r|                    d| d| d           |t          j
        t          <   |	rM|                    d|	 d|
 d           |	t          j
        t           <   dd l}|j                                         ddlm} t3          |          5  |j         d d d            n# 1 swxY w Y   t7          d           j        t8          <   t;                      d S )Nmarkersa  django_db(transaction=False, reset_sequences=False, databases=None, serialized_rollback=False): Mark the test as using the Django test database.  The *transaction* argument allows you to use real transactions in the test like Django's TransactionTestCase.  The *reset_sequences* argument resets database sequences before the test.  The *databases* argument sets which database aliases the test uses (by default, only 'default'). Use '__all__' for all databases.  The *serialized_rollback* argument enables rollback emulation for the test.zurls(modstr): Use a different URLconf for this test, similar to the `urls` attribute of Django's `TestCase` objects.  *modstr* is a string specifying the module of a URL config, e.g. "my_app.test_urls".zmignore_template_errors(): ignore errors from invalid template variables (if --fail-on-template-vars is used).r@   r   option
str | NoneenvnamerG   r/   #tuple[str, str] | tuple[None, None]c                    | r| dfS |t           j        v rt           j        |         dfS                     |          }|r|dfS dS )Nr   envini)NN)osenvirongetini)r   r   cfgvalr   s      rM   _get_option_with_sourcez>pytest_load_initial_conftests.<locals>._get_option_with_source?  sa      	$8##bj  :g&--$$W-- 	!5= zrO   z
settings: z (from )zconfiguration: r   r%   T	_ispytest)r   r   r   rG   r/   r   )addinivalue_lineparse_known_argsversionr8   r   r   r   PROJECT_SCAN_DISABLEDrD   r   r   getrK   r;   rJ   r=   rI   r   report_header_keyrt   configurations.importerimporterinstallr   r%   rY   	DATABASESDjangoDbBlockerr   r   )r   r-   rU   optionsr@   _django_project_scan_outcomer   r;   	ds_sourcer=   	dc_sourcereport_headerconfigurationsdj_settingss   `             rM   pytest_load_initial_conftestsr     s    !!
	   !!	   !!	:   %%d++G ', ,1224I   ='B4'H'H$$'<$ 	7bjnn-FGGIbcc7 8997
 17
,-      ,+GJ8KLLMB	++GJ8IJJMB	!M,9L()	 "A"AAYAAABBB*,
&' 	.  !J2!J!Ji!J!J!JKKK,.BJ() +***#++--- 	877777!">?? 	" 	"!!	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 0?/N/N/NL+,,s   0HHHT)trylastc                $    t          |            d S rk   )r   )r   s    rM   pytest_configurer   k  s     &rO   list[str] | Nonec                    | j         t                   }dt          j        v r*dd l}|                    dd |j                                |rdd                    |          z   gS d S )Nr2   r   z	version: zdjango: r   )r   r   rz   r   r2   r{   get_versionr   )r   r   r2   s      rM   pytest_report_headerr   r  sw    L!23M3;Q B,>F,>,@,@ B BCCC 7TYY}555664rO   	collectorpytest.Collectorc                    dt           j        vrd S t          | t          j                  sd S t          | j        dd          }|sd S ddlm} t          | j        |          sd S |D ]}| 
                    |           d S Nr2   tags r   )SimpleTestCase)rz   r   r   pytestClassgetattrobjdjango.testr   
issubclass
add_marker)r   r   r   tags       rM   pytest_collectstartr     s    s{""i.. 9=&"--D ******im^44  " "S!!!!" "rO   itempytest.Itemc                    dt           j        vrd S t          | t          j                  sd S t          | j        dd          }|sd S ddlm} t          | j
        |          sd S |D ]}|                     |           d S r   )rz   r   r   r   Functionr   r   r   r   r   clsr   )r   r   r   r   s       rM   pytest_itemcollectedr     s    s{""dFO,, 48VR((D ******dh//    rO   )tryfirstitemslist[pytest.Item]c                t    t                      sd S ddlmm d	fd}|                     |           d S )
Nr   )TestCaseTransactionTestCasetestr   r/   intc                .   t          | dd           }|r$t          |          rd}t          |           }nT|                     d          }|rt          |          \  }}}}}	d}|p|}nd}d}t          | dg           }
|pd|
v }|pd|
v }|rdS |rd	S d
S )Nr   T	django_dbFfixturenamesr&   r   r
   r      )r   r   get_closest_markerr'   )r   test_clsuses_dbtransactional	marker_dbtransactionreset_sequences	databasesserialized_rollbackavailable_appsfixturesr   r   s              rM   get_order_numberz7pytest_collection_modifyitems.<locals>.get_order_number  s    4-- 	2
8-@AA 	2G *8X > >>MM//<<I & 'y11#'" + > %t^R88H)K-?8-KM1!1G 	1 	11rO   )key)r   r   r/   r   )r(   r   r   r   sort)r   r   r   r   s     @@rM   pytest_collection_modifyitemsr    sr     )** 99999999      @ 
JJ#J$$$$$rO   session)autousescoperequestpytest.FixtureRequestc              #    K   t                      rlt          | j                   ddlm}m} | j                            d          }|dk    rd}nt          |dd          } ||           dV   |             dS dV  dS )a  
    Ensure that Django is loaded and has its testing environment setup.

    XXX It is a little dodgy that this is an autouse fixture.  Perhaps
        an email fixture should be requested in order to be able to
        use the Django email machinery just like you need to request a
        db fixture for access to the Django database, etc.  But
        without duplicating a lot more of Django's test support code
        we need to follow this model.
    r   )setup_test_environmentteardown_test_environmentrB   keepNF)debug)r(   r   r   django.test.utilsr  r	  r   r   )r  r  r	  	debug_inir  s        rM   django_test_environmentr    s       %&& gn%%%WWWWWWWWN))*=>>	EE&y2EuMMEU++++!!##### 	rO   )r  DjangoDbBlocker | Nonec                T    t                      sdS | j        j        t                   }|S )a  Wrapper around Django's database access.

    This object can be used to re-enable database access.  This fixture is used
    internally in pytest-django to build the other fixtures and can be used for
    special database handling.

    The object is a context manager and provides the methods
    .unblock()/.block() and .restore() to temporarily enable database access.

    This is an advanced feature that is meant to be used to implement database
    fixtures.
    N)r(   r   r   r   )r  r   s     rM   django_db_blockerr    s.     )** t~+,@ArO   )r  c                l    | j                             d          }|r|                     d           dS dS )z:Implement the django_db marker, internal to pytest-django.r   r   N)noder   getfixturevalue)r  markers     rM   _django_db_markerr  
  sF     \,,[99F 5 3444445 5rO   classr  r   c              #  2  K   t                      rt          |           sdV  dS ddlm} |j        }dd}	 ||_        |                     d           |                                5  dV  ddd           n# 1 swxY w Y   ||_        dS # ||_        w xY w)	z3Setup a django unittest, internal to pytest-django.Nr   )TestCaseFunctionr/   r0   c                2    |                      |            d S )N)result)	_testcaseselfs    rM   non_debugging_runtestz5_django_setup_unittest.<locals>.non_debugging_runtest#  s    d#####rO   r   r/   r0   )r(   r   _pytest.unittestr  runtestr  unblock)r  r  r  original_runtestr  s        rM   _django_setup_unittestr%    s      )** 2DW2M2M 
 211111'/$ $ $ $4#8  1222&&(( 	 	EEE	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 $4   #3 3333s/   0B (A9-B 9A==B  A=B 	Bc                 F    t                      sd S ddlm}  | j        d d = d S Nr   mailr(   django.corer)  outboxr(  s    rM   _dj_autoclear_mailboxr-  1  s8    (**       AAArO   django_mail_patch_dnsr-  *list[django.core.mail.EmailMessage] | Nonec                <    t                      sd S ddlm} |j        S r'  r*  )r.  r-  r)  s      rM   
mailoutboxr1  ;  s1    
 )** t      ;rO   monkeypatchpytest.MonkeyPatchdjango_mail_dnsnamec                J    ddl m} |                     |j        d|           d S )Nr   r(  DNS_NAME)r+  r)  setattrmessage)r2  r4  r)  s      rM   r.  r.  H  s7    
 !     j2EFFFFFrO   c                     dS )Nzfake-tests.example.comr   r   rO   rM   r4  r4  R  s    ##rO   c              #  ^  K   | j                             d          }|r`t                       ddl}ddlm}m} t          |          }|j        j	        j
        }||j        j	        _
         |              |d           dV  |r(||j        j	        _
         |              |d           dS dS )z>Apply the @pytest.mark.urls marker, internal to pytest-django.urlsr   N)clear_url_cachesset_urlconf)r  r   r)   r   django.urlsr<  r=  validate_urlsr   r%   ROOT_URLCONF)r  r  r2   r<  r=  r;  original_urlconfs          rM   _django_set_urlconfrB  W  s       \,,V44F 	========V$$!;/<,0)D	EEE ,<) 	D rO   c               #    K    G d d          } t           j                                        5 }t          j                            t          d          dk    rKt                      r=ddlm	} |j
        r0|                    |j
        d         d         d |                        d	V  d	d	d	           d	S # 1 swxY w Y   d	S )
a  Fixture that fails for invalid variables in templates.

    This fixture will fail each test that uses django template rendering
    should a template contain an invalid template variable.
    The fail message will include the name of the invalid variable and
    in most cases the template name.

    It does not raise an exception, but fails, as the stack trace doesn't
    offer any helpful information to debug.
    This behavior can be switched off using the marker:
    ``pytest.mark.ignore_template_errors``
    c                  B    e Zd ZdZddZddZedd
            ZddZdS )@_fail_for_invalid_template_variable.<locals>.InvalidVarExceptionz0Custom handler for invalid strings in templates.r/   r0   c                    d| _         d S )NT)failr  s    rM   __init__zI_fail_for_invalid_template_variable.<locals>.InvalidVarException.__init__  s    DIIIrO   r   rG   rA   c                    |dk    S )Nz%sr   )r  r   s     rM   __contains__zM_fail_for_invalid_template_variable.<locals>.InvalidVarException.__contains__  s    $;rO   r   c                    t          j                    } | dd          D ]K}|d         }|dk    r;|d         }	 |j        d         j        }n# t          t
          f$ r d }Y nw xY w||c S Lddlm} t          d |           }|d         }t          d t          j	        |                    d	         }|d         }t          ||          r	|j        }	|	S d S )
Nr      renderr   r  )Templatec                6    |d         dk    rd|d         v r|p| S )NrL  rM  zbase.pyr
   r   rq   ys     rM   <lambda>z^_fail_for_invalid_template_variable.<locals>.InvalidVarException._get_origin.<locals>.<lambda>  s'    QqTX-I)qt2CINQ rO   c                "    |d         dk    r|p| S )Nr   f_localsr   rP  s     rM   rR  z^_fail_for_invalid_template_variable.<locals>.InvalidVarException._get_origin.<locals>.<lambda>  s    QqTZ/5A: rO   r
   )inspectstackrT  originAttributeErrorr   django.templaterN  r   
getmembersr   r   )
rV  ffuncframerW  rN  	frameinforT  templater   s
             rM   _get_originzL_fail_for_invalid_template_variable.<locals>.InvalidVarException._get_origin  s"   MOOE 122Y 
& 
&t8##aDE&!&!7!>*H5 & & &!%&)%000000 NNPU I aLE::G<Nu<U<U H  'H(H-- $M4s   A

A A varc                    |                                  }|r
d| d| d}nd| d}| j        rt          j        |           d S |S )NzUndefined template variable 'z' in '')r`  rG  r   )r  ra  rW  rX   s       rM   __mod__zH_fail_for_invalid_template_variable.<locals>.InvalidVarException.__mod__  sj    %%''F =JcJJJJJ<c<<<y C     
rO   Nr   )r   rG   r/   rA   )r/   r   )ra  rG   r/   rG   )	__name__
__module____qualname____doc__rH  rJ  staticmethodr`  rd  r   rO   rM   InvalidVarExceptionrE    sw        >>	 	 	 		 	 	 	 
"	 "	 "	 
"	H		 		 		 		 		 		rO   rj  r   r   r   r   OPTIONSstring_if_invalidN)r   MonkeyPatchcontextr   r   r   rK   r(   r   r%   	TEMPLATESsetitem)rj  mpr   s      rM   #_fail_for_invalid_template_variablerr  p  s1     7 7 7 7 7 7 7 7r 
		#	#	%	% JNN4g>>&HH-// I <;;;;;$ 

)!,Y7'''))  
 	                 s   A9B44B8;B8c                4   |j                             dd          }t          j                            t          d          dk    rM|rMt                      rAddlm} |j        r6| 	                    |j        d         d         d         d	d
           dS dS dS dS dS )zTApply the @pytest.mark.ignore_template_errors marker,
    internal to pytest-django.ignore_template_errorsNr   r   r   r   rk  rl  rG  F)
keywordsr   r   r   rK   r(   r   r%   ro  r7  )r2  r  r  r   s       rM   "_template_string_if_invalid_markerrv    s     !!":DAAF	z~~/99VCC 	355 	;;;;;;$ ##)!,Y78KL     DC	 	 	 	 rO   c                     t                      r0ddlm}  d| j        v r#ddlm} |j                                         dS dS dS )zqClears ``django.contrib.sites.models.SITE_CACHE`` to avoid
    unexpected behavior with cached site objects.
    r   r   zdjango.contrib.sites)SiteN)r(   r   r%   INSTALLED_APPSdjango.contrib.sites.modelsrx  objectsclear_cache)r   rx  s     rM   _django_clear_site_cacher}    sq     %&& '777777![%???888888L$$&&&&&' ' @?rO   c                  &    e Zd ZddZddZddZdS )_DatabaseBlockerContextManager
db_blockerr   r/   r0   c                    || _         d S rk   )_db_blocker)r  r  s     rM   rH  z'_DatabaseBlockerContextManager.__init__  s    %rO   c                    d S rk   r   r  s    rM   	__enter__z(_DatabaseBlockerContextManager.__enter__  s    rO   exc_typetype[BaseException] | None	exc_valueBaseException | None	tracebacktypes.TracebackType | Nonec                8    | j                                          d S rk   )r  restore)r  r  r  r  s       rM   __exit__z'_DatabaseBlockerContextManager.__exit__  s     	  """""rO   N)r  r   r/   r0   r   )r  r  r  r  r  r  r/   r0   )re  rf  rg  rH  r  r  r   rO   rM   r  r    sP        & & & &   # # # # # #rO   r  c                  `    e Zd ZdZddddZedd
            ZddZddZddZ	ddZ
ddZdS )r   zyManager for django.db.backends.base.base.BaseDatabaseWrapper.

    This is the object returned by django_db_blocker.
    Fr   r   rA   r/   r0   c               D    |st          d          g | _        d | _        d S )NzVThe DjangoDbBlocker constructor is private. use the django_db_blocker fixture instead.)	TypeError_history_real_ensure_connection)r  r   s     rM   rH  zDjangoDbBlocker.__init__  s8     	=  
 '+$$$rO   0django.db.backends.base.base.BaseDatabaseWrapperc                8    ddl m} | j        |j        | _        |S )Nr   )BaseDatabaseWrapper)django.db.backends.base.baser  r  ensure_connection)r  r  s     rM   _dj_db_wrapperzDjangoDbBlocker._dj_db_wrapper  s0    DDDDDD '/+>+PD(""rO   c                N    | j                             | j        j                   d S rk   )r  rt   r  r  r  s    rM   _save_active_wrapperz$DjangoDbBlocker._save_active_wrapper  s$    T0BCCCCCrO   r	   c                 $    d}t          d          )NTzoDatabase access not allowed, use the "django_db" mark, or the "db" or "transactional_db" fixtures to enable it.)RuntimeError)rU   kwargs__tracebackhide__s      rM   _blocking_wrapperz!DjangoDbBlocker._blocking_wrapper  s      @
 
 	
rO   ContextManager[None]c                j    |                                   | j        | j        _        t	          |           S )z%Enable access to the Django database.)r  r  r  r  r  r  s    rM   r#  zDjangoDbBlocker.unblock$  s0    !!###040L--d333rO   c                j    |                                   | j        | j        _        t	          |           S )z&Disable access to the Django database.)r  r  r  r  r  r  s    rM   r   zDjangoDbBlocker.block*  s0    !!###040F--d333rO   c                L    | j                                         | j        _        d S rk   )r  popr  r  r  s    rM   r  zDjangoDbBlocker.restore0  s!    040A0A0C0C---rO   N)r   rA   r/   r0   )r/   r  r   )r/   r	   )r/   r  )re  rf  rg  rh  rH  propertyr  r  r  r#  r   r  r   rO   rM   r   r     s         
 -2 , , , , , , # # # X#D D D D
 
 
 
4 4 4 44 4 4 4D D D D D DrO   c                .    dd} || j         i | j        S )zValidate the urls marker.

    It checks the signature and creates the `urls` attribute on the
    marker which will have the correct value.
    r;  r   r/   c                    | S rk   r   )r;  s    rM   apifunzvalidate_urls.<locals>.apifun?  s    rO   )r;  r   r/   r   )rU   r  )r  r  s     rM   r?  r?  8  s1        66;0&-000rO   )r-   r.   r/   r0   )rP   rG   r/   rQ   )r/   rG   )r   r   r/   r0   rk   )rq   r   r   rG   r7   r   r/   rA   )r   r   r-   r.   rU   r   r/   r0   )r   r   r/   r   )r   r   r/   r0   )r   r   r/   r0   )r   r   r/   r0   )r  r  r/   rQ   )r  r  r/   r  )r  r  r/   r0   )r  r  r  r   r/   rQ   r   )r.  r0   r-  r0   r/   r/  )r2  r3  r4  rG   r/   r0   )r2  r3  r  r  r/   r0   )r/   r   )\rh  
__future__r   
contextlibrU  r   re   rz   types	functoolsr   typingr   r   r   r   r	   r   django_compatr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   lazy_djangor(   r)   r2   rJ   rI   rK   hookimplrN   r}   r~   r   contextmanagerrY   r   r   r   StashKeyrG   r   r   r   r   r   r   r  fixturer  r  r  r%  r-  r1  r.  r4  rB  rr  rv  r}  r  r   r   r?  r   rO   rM   <module>r     s   
 # " " " " "      				  



        K K K K K K K K K K K K K K  - - - - - -                                                           < J I I I I I I I  MMM / * 8  V V V Vt9  &  ) ) ) )" " " "J   ,      & /FODI.00  _  _  _  _ D     
 
 
 
 " " " "*   ( $'% '% '%  '%T I...   /.: i      ! ( 5 5 5 5 G,,,4 4 4 -,4<     	 	 	 	 G G G G $ $ $ $    0 I...T T /.Tn    & ' ' ' '"# # # # # # # # 3D 3D 3D 3D 3D 3D 3D 3Dn 8v799 
1 
1 
1 
1 
1 
1rO   