https://t.me/AnonymousX5
Server : Apache
System : Linux cvar2.toservers.com 3.10.0-962.3.2.lve1.5.73.el7.x86_64 #1 SMP Wed Aug 24 21:31:23 UTC 2022 x86_64
User : njnconst ( 1116)
PHP Version : 8.4.18
Disable Function : NONE
Directory :  /usr/lib64/python2.7/site-packages/django/contrib/gis/tests/relatedapp/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/lib64/python2.7/site-packages/django/contrib/gis/tests/relatedapp/tests.pyc
�
r�\c@@s.ddlmZddlmZddlmZmZmZmZm	Z	m
Z
ddlmZddl
mZer�ddlmZmZmZmZmZddlmZddlmZmZmZd	d
lmZmZmZmZmZm Z m!Z!neeoed�defd
��Y�Z"dS(i(tabsolute_import(tHAS_GEOS(tHAS_SPATIAL_DBtmysqltoracletno_mysqlt	no_oraclet
no_spatialite(tTestCase(t
skipUnless(tCollecttCounttExtenttFtUnion(tGeometry(tGEOSGeometrytPointt
MultiPointi(tCitytLocationtDirectoryEntrytParceltBooktAuthortArticles!Geos and spatial db are required.tRelatedGeoModelTestcB@s�eZd�Zed��Zeed���Zed��Zd�Zd�Z	d�Z
d�Zd�Ze
d	��Zd
�Ze
d��Zd�Ze
d
��Ze
d��Zee
ed����Zd�Zd�ZRS(cC@s�tjj�}tjj�}tjjd�}dddf}x�|||fD]}}xtt||�D]c\}}|\}}	}
}|j||j�|j|	|j�|jt|
|�|j	j
�qeWqOWdS(s:Testing `select_related` on geographic models (see #7126).tlocationtAuroratTXgƆn�aX�g���tw�@@tRoswelltNMg9�d��!Z�gW%�}��@@t	KecksburgtPAg�u�|�S�g��67�D@N(RRgƆn�aX�g���tw�@@(RRg9�d��!Z�gW%�}��@@(R R!g�u�|�S�g��67�D@(Rtobjectstalltselect_relatedtziptassertEqualtnametstateRRtpoint(tselftqs1tqs2tqs3tcitiestqstreftctnmtsttlontlat((sK/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/relatedapp/tests.pyttest02_select_relateds	c@s�d���fd�}dddf}xa|D]Y\}}}ttjjd|�j|d
d��}|t||�|djj�q.WdS(sHTesting the `transform` GeoQuerySet method on related geographic models.ic@sL�j|j|j���j|j|j���j|j|j�dS(N(tassertAlmostEqualtxtyR&tsrid(R0tpnt(R*ttol(sK/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/relatedapp/tests.pyt	check_pnt.sR i�s(POINT(1490553.98959621 314792.131023984)Ri�s(POINT(481902.189077221 868477.766629735)Ri�s'POINT(2269923.2484839 7069381.28722222)R't
field_nametlocation__pointN(s	Kecksburgi�s(POINT(1490553.98959621 314792.131023984)(sRoswelli�s(POINT(481902.189077221 868477.766629735)(sAurorai�s'POINT(2269923.2484839 7069381.28722222)(tlistRR"tfiltert	transformRRR)(R*R=ttransformedR'R:twktR/((R*R<sK/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/relatedapp/tests.pyttest03_transform_related's	*cC@s�tjjtd��}d
}d}tjjdd�}tjjdd	�jdd�}|d
}d}xb||f||f||fgD]?\}}	x0t||	�D]\}
}|j|
||�q�Wq�WdS(sITesting the `extent` GeoQuerySet aggregates on related geographic models.R?g9�d��!Z�g�|zl�=@g�u�|�S�g��67�D@gƆn�aX�R>R(Rtlocation__point__extentiN(g9�d��!Z�g�|zl�=@g�u�|�S�g��67�D@(gƆn�aX�g�|zl�=@g�u�|�S�g��67�D@(RR"t	aggregateRtextenttexcludeR%R7(R*taggst
all_extentttxpa_extentte1te2te3R<R0tetref_valte_val((sK/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/relatedapp/tests.pyt test04a_related_extent_aggregate?s!
.cC@sFtjjtd��}tdd�}tdd�}tdd�}tdd	�}td
d�}tr�t|||||dd
�}t||dd
�}n3t|||||dd
�}t||dd
�}tjjdd�}	tjjdd�jdd�}
|d}|j	||	�|j	||
�|j	||�dS(sKTesting the `unionagg` GeoQuerySet aggregates on related geographic models.R?g9�d��!Z�gW%�}��@@gƆn�aX�g���tw�@@g�u�|�S�g��67�D@gIG9�M3X�g�M�qd@@g� ��=�W�g�|zl�=@R:i�R>tname__inRtHoustontDallass
Fort Worthtlocation__point__unionN(sRoswellRURVs
Fort Worth(
RR"RGRRRRtunionaggRIR&(R*RJtp1tp2tp3tp4tp5tref_u1tref_u2tu1tu2tu3((sK/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/relatedapp/tests.pyttest04b_related_union_aggregateSs"!
cC@sttjj�j��}dS(s`Testing that calling select_related on a query over a model with an FK to a model subclass worksN(R@RR"R#R$(R*tl((sK/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/relatedapp/tests.pyt$test05_select_related_fk_to_subclassvsc	
C@stddd�}tjjdd�}|jj}|jddt�}|jd�}t	jj
dd	d
|d|d|d
|d|�}|j}|jddt�}t	jj
ddd
|d|d|d
|d|�}t	jjdt
d
��}|jdt|��|jd|dj�tstt	jjdt
d
��}|jdt|��|jd|dj�nt	jjdt
d��}|jdt|��|jd	|dj�ts
t	jjdt
d��}|jdt|��|jd	|dj�ndS(s*Testing F() expressions on GeometryFields.ssPOLYGON((-97.501205 33.052520,-97.501205 33.052576,-97.501150 33.052576,-97.501150 33.052520,-97.501205 33.052520))R:i�R'Ri�tcloneidtP1tcitytcenter1tcenter2tborder1tborder2tP2tcenter1__withiniitcenter2__withintcity__location__pointtborder2__containsN(RRR"tgetRR)RBtTruetbufferRtcreatetcentroidRAR
R&tlenR'R(	R*tb1tpcitytc1tc2tb2RYRZR/((sK/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/relatedapp/tests.pyttest06_f_expressions{s.3	3cC@s�tjj�}tjj�}tjj�}x�t|||�D]q\}}}|jt|dt��|jt|dt��|j	|j
|d�|j	|j
|d�q@WdS(s4Testing values() and values_list() and GeoQuerySets.R)iN(RR"R#tvaluestvalues_listR%t
assertTruet
isinstanceRR&R)(R*tgqstgvqstgvlqstmtdtt((sK/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/relatedapp/tests.pyt
test07_values�s"cC@s[tjj�}tjjd�}x3t||�D]"\}}|j|j|j�q1WdS(s0Testing defer() and only() on Geographic models.R)N(RR"R#tdeferR%R&R)(R*R/tdef_qstloctdef_loc((sK/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/relatedapp/tests.pyttest08_defer_only�scC@s|d	}d
}tjjd�jdd�}xKt|||�D]7\}}}|j|d|�|j|d|�q=WdS(sMEnsuring correct primary key column is selected across relations. See #10757.iiiiitidtlocation__idN(iiiii(iiiii(RR"torder_byR~R%R&(R*tcity_idstloc_idstids_qstval_dicttc_idtl_id((sK/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/relatedapp/tests.pyttest09_pk_relations�s"cC@s�tjjdd�jjjd�}tjjdd�jjjd�}tjjd|�}tjjd|�}||B}g|D]}|j^q�}|jdt	|��|j
d|k�|j
d|k�dS(s9Testing the combination of two GeoQuerySets.  See #10807.R'Rg�������?R tlocation__point__withiniN(RR"RrRR)RtRAR'R&RwR�(R*tbuf1tbuf2R+R,tcombinedR1tnames((sK/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/relatedapp/tests.pyttest10_combine�s$$
cC@scddl}ddlm}tjj�}|j|j�}|j|�}|j	||j
�dS(s?Ensuring GeoQuery objects are unpickled correctly.  See #10839.iN(tGeoQuery(tpicklet django.contrib.gis.db.models.sqlR�RR"R#tdumpstquerytloadsR&t	__class__(R*R�R�R/tq_strtq((sK/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/relatedapp/tests.pyttest11_geoquery_pickle�scC@sYtjjdd�}tjjdtd��jd|jj�}|jd|j	�dS(sBTesting `Count` aggregate use with the `GeoManager` on geo-fields.R'RVt
num_citiesRhR�iN(
RR"RrRtannotateRRR�R&R�(R*tdallasR�((sK/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/relatedapp/tests.pyt
test12a_count�s-cC@s�tjjdtd��jdd�}tjjd�jdtd��jdd�}|jdt|��|jd|dj�|jdt|��|jd|dd�dS(	sRTesting `Count` aggregate use with the `GeoManager` on non geo-fields. See #11087.t	num_bookstbookst
num_books__gtiR'iiN(	RR"R�RRAR~R&RwR�(R*R/tvqs((sK/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/relatedapp/tests.pyt
test12b_count�s'0cC@s�tjjdd�jdtd��jddd�}|jdt|��|jd|dd�|jt	|ddt
��d	S(
s8Testing `Count` aggregate with `.values()`.  See #15305.R�iR�RhR)iiiN(RR"RAR�RR~R&RwR�R�R(R*R/((sK/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/relatedapp/tests.pyt
test13c_counts6cC@sJtjjdd�}tjjd�jdd�}|jd|j�dS(sOTesting `select_related` on a nullable ForeignKey via `GeoManager`. See #11381.ttitlesWithout AuthortauthorN(RR"RuR$RrR&tNoneR�(R*t	no_authortb((sK/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/relatedapp/tests.pyttest13_select_related_null_fkscC@s�td�}tjjdd�jdd�}tjjdd�jtd��d}x:||fD],}|jdt|��|j||�qbWdS(	sATesting the `collect` GeoQuerySet method and `Collect` aggregate.s_MULTIPOINT(-97.516111 33.058333,-96.801611 32.782057,-95.363151 29.763374,-96.801611 32.782057)R(RR>R?tlocation__point__collectiN(	RRR"RAtcollectRGR
R&Rw(R*tref_geomRzR{tcoll((sK/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/relatedapp/tests.pyttest14_collects	!(cC@s%tjjd�}t|j�}dS(sTTesting doing select_related on the related name manager of a unique FK. See #13934.tauthor__articleN(RR"R$tstrR�(R*R/tsql((sK/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/relatedapp/tests.pyttest15_invalid_select_related(scC@sggttjjdtd��jdd��D]}|j^q.}|j�|jddg|�dS(sMEnsure annotated date querysets work if spatial backend is used.  See #14648.R�R�tdobtyeari�i�N(	R@RR"R�RtdatesR�tsortR&(R*tdttbirth_years((sK/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/relatedapp/tests.pyttest16_annotated_date_queryset0s@
(t__name__t
__module__R6RRERRSRcReR}R�R�R�RR�R�R�R�R�R�R�R�R�(((sK/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/relatedapp/tests.pyRs*	#		0			
	
			N(#t
__future__Rtdjango.contrib.gis.geosRtdjango.contrib.gis.tests.utilsRRRRRRtdjango.testRtdjango.utils.unittestR	tdjango.contrib.gis.db.modelsR
RRR
Rt#django.contrib.gis.geometry.backendRRRRtmodelsRRRRRRRR(((sK/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/relatedapp/tests.pyt<module>s.(7

https://t.me/AnonymousX5 - 2025