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/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/lib64/python2.7/site-packages/django/contrib/gis/tests/test_geoforms.pyc
�
r�\c@sddlmZddlmZddlmZddlmZddlm	Z	ddl
mZddlm
Z
er�ddlmZdd	lmZne
eo�ed
�defd��Y�Ze
eo�ed
�defd��Y�Ze
eo�ed�defd��Y�ZdS(i����(tValidationError(tHAS_GDAL(tHAS_SPATIALREFSYS(tSimpleTestCase(tsix(tescape(t
skipUnless(tforms(tGEOSGeometrys;GeometryFieldTest needs gdal support and a spatial databasetGeometryFieldTestcBs>eZd�Zd�Zd�Zd�Zd�Zd�ZRS(cCs7tj�}x$dD]}|jt|j|�qWdS(s3Testing GeometryField initialization with defaults.tblahitFoOiN(R
iRNi(Rt
GeometryFieldtNonetassertRaisesRtclean(tselftfldtbad_default((sH/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/test_geoforms.pyt	test_inits
cCs�tjdd�}|jd�}|jd|j�tjdd�}d}tddd�}|jd�}|j|j||��dS(	s&Testing GeometryField with a SRID set.tsridi�sPOINT(5 23)i�}gH�����z>s)POINT (951640.547328465 4219369.26171664)s&SRID=4326;POINT (-95.363151 29.763374)N(RRRtassertEqualRRt
assertTruetequals_exact(RRtgeomttolt
xform_geomtcleaned_geom((sH/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/test_geoforms.pyt	test_sridscCsdtj�}tj|tjd��|jd�WdQXtjdt�}|j|jd��dS(s;Testing GeometryField's handling of null (None) geometries.sNo geometry value provided.Ntrequired(	RRRtassertRaisesRegexRRR
tFalsetassertIsNone(RR((sH/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/test_geoforms.pyt	test_null&s
cCs�tj�}x-dD]%}|jt|�|j|��qWtjdd�}|jtd�|jd��|jtd�|jd��|jtj|jd�dS(s=Testing GeometryField's handling of different geometry types.sPOINT(5 23)s)MULTIPOLYGON(((0 0, 0 1, 1 1, 1 0, 0 0)))sLINESTRING(0 0, 1 1)t	geom_typetPOINTN(sPOINT(5 23)s)MULTIPOLYGON(((0 0, 0 1, 1 1, 1 0, 0 0)))sLINESTRING(0 0, 1 1)(RRRRRt	to_pythonRR(RRtwkttpnt_fld((sH/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/test_geoforms.pyttest_geom_type2s
#cCsjtj�}x-dD]%}|jt|�|j|��qWx'd	D]}|jtj|j|�qCWdS(
sf
        Testing to_python returns a correct GEOSGeometry object or
        a ValidationError
        sPOINT(5 23)s)MULTIPOLYGON(((0 0, 0 1, 1 1, 1 0, 0 0)))sLINESTRING(0 0, 1 1)sPOINT(5)s,MULTI   POLYGON(((0 0, 0 1, 1 1, 1 0, 0 0)))sBLAH(0 0, 1 1)N(sPOINT(5 23)s)MULTIPOLYGON(((0 0, 0 1, 1 1, 1 0, 0 0)))sLINESTRING(0 0, 1 1)(sPOINT(5)s,MULTI   POLYGON(((0 0, 0 1, 1 1, 1 0, 0 0)))sBLAH(0 0, 1 1)(RRRRR$RR(RRR%((sH/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/test_geoforms.pyttest_to_python@s

#
cCs�dtjfd��Y}|�}|jdjd�}|j|td��|jd|j�td�}|didd6di|d6�}|j|j��dS(	Nt	PointFormcBs#eZejdddej�ZRS(Ri�twidget(t__name__t
__module__Rt
PointFieldt	TextInputtpt(((sH/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/test_geoforms.pyR)NsR/sPOINT(5 23)i�sSRID=4326;POINT(5 23)tdatatinitial(	RtFormtfieldsRRRRtassertFalsethas_changed(RR)tformt
cleaned_pttpoint((sH/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/test_geoforms.pyttest_field_with_text_widgetMs	#(R+R,RRR!R'R(R9(((sH/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/test_geoforms.pyR	
s					
s>SpecializedFieldTest needs gdal support and a spatial databasetSpecializedFieldTestcBskeZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�ZRS(cCshitd�d6td�d6td�d6td�d6td	�d
6td�d6td
�d6|_dS(Ns)SRID=4326;POINT(9.052734375 42.451171875)R8s�SRID=4326;MULTIPOINT((13.18634033203125 14.504356384277344),(13.207969665527 14.490966796875),(13.177070617675 14.454917907714))t
multipointskSRID=4326;LINESTRING(-8.26171875 -0.52734375,-7.734375 4.21875,6.85546875 3.779296875,5.44921875 -3.515625)t
linestrings�SRID=4326;MULTILINESTRING((-16.435546875 -2.98828125,-17.2265625 2.98828125,-0.703125 3.515625,-1.494140625 -3.33984375),(-8.0859375 -5.9765625,8.525390625 -8.7890625,12.392578125 -0.87890625,10.01953125 7.646484375))tmultilinestrings�SRID=4326;POLYGON((-1.669921875 6.240234375,-3.8671875 -0.615234375,5.9765625 -3.955078125,18.193359375 3.955078125,9.84375 9.4921875,-1.669921875 6.240234375))tpolygons@SRID=4326;MULTIPOLYGON(((-17.578125 13.095703125,-17.2265625 10.8984375,-13.974609375 10.1953125,-13.359375 12.744140625,-15.732421875 13.7109375,-17.578125 13.095703125)),((-8.525390625 5.537109375,-8.876953125 2.548828125,-5.888671875 1.93359375,-5.09765625 4.21875,-6.064453125 6.240234375,-8.525390625 5.537109375)))tmultipolygonsSRID=4326;GEOMETRYCOLLECTION(POINT(5.625 -0.263671875),POINT(6.767578125 -3.603515625),POINT(8.525390625 0.087890625),POINT(8.0859375 -2.13134765625),LINESTRING(6.273193359375 -1.175537109375,5.77880859375 -1.812744140625,7.27294921875 -2.230224609375,7.657470703125 -1.25244140625))tgeometrycollection(Rt
geometries(R((sH/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/test_geoforms.pytsetUp^s



	


cCsL|j|j��|j�}|jd|�|jdt|j��dS(st
        Make sure the MapWidget js is passed in the form media and a MapWidget
        is actually created
        snew MapWidget(options);sgis/js/OLMapWidget.jsN(Rtis_validtas_ptassertIntstrtmedia(Rt
form_instancetrendered((sH/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/test_geoforms.pytassertMapWidget�scCs7|jd|�|jd|�|j|j|�dS(s4Makes sure the wkt and a textarea are in the contents
<textarea RN(RER%(RRRI((sH/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/test_geoforms.pytassertTextarea�scCs#dtjfd��Y}|jd}|di|d6�}|j||j��|j|�|j|�j��|didd6�}|j|j��|jdt	|j
�k�xbg|jj�D]\}}|dkr�|^q�D],}|j|di|jd6�j��q�WdS(NR)cBseZej�ZRS((R+R,RR-tp(((sH/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/test_geoforms.pyR)�sR8R0RLssome invalid geomsInvalid geometry value(
RR2RARKRDRJR4RCRRFterrorstitemsR%(RR)RR6tinvalidtkey((sH/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/test_geoforms.pyttest_pointfield�s

;cCs�dtjfd��Y}|jd}|di|d6�}|j||j��|j|�|j|�j��xbg|jj�D]\}}|dkr�|^q�D],}|j|di|j	d6�j��q�WdS(NR)cBseZej�ZRS((R+R,RtMultiPointFieldRL(((sH/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/test_geoforms.pyR)�sR;R0RL(
RR2RARKRDRJR4RCRNR%(RR)RR6RPRO((sH/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/test_geoforms.pyttest_multipointfield�s

;cCs�dtjfd��Y}|jd}|di|d6�}|j||j��|j|�|j|�j��xbg|jj�D]\}}|dkr�|^q�D],}|j|di|j	d6�j��q�WdS(NtLineStringFormcBseZej�ZRS((R+R,RtLineStringFieldtl(((sH/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/test_geoforms.pyRT�sR<R0RVRL(
RR2RARKRDRJR4RCRNR%(RRTRR6RPRO((sH/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/test_geoforms.pyttest_linestringfield�s

;cCs�dtjfd��Y}|jd}|di|d6�}|j||j��|j|�|j|�j��xbg|jj�D]\}}|dkr�|^q�D],}|j|di|j	d6�j��q�WdS(NRTcBseZej�ZRS((R+R,RtMultiLineStringFieldRV(((sH/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/test_geoforms.pyRT�sR=R0RVRL(
RR2RARKRDRJR4RCRNR%(RRTRR6RPRO((sH/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/test_geoforms.pyttest_multilinestringfield�s

;cCs�dtjfd��Y}|jd}|di|d6�}|j||j��|j|�|j|�j��xbg|jj�D]\}}|dkr�|^q�D],}|j|di|j	d6�j��q�WdS(NtPolygonFormcBseZej�ZRS((R+R,RtPolygonFieldRL(((sH/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/test_geoforms.pyRZ�sR>R0RL(
RR2RARKRDRJR4RCRNR%(RRZRR6RPRO((sH/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/test_geoforms.pyttest_polygonfield�s

;cCs�dtjfd��Y}|jd}|di|d6�}|j||j��|j|�|j|�j��xbg|jj�D]\}}|dkr�|^q�D],}|j|di|j	d6�j��q�WdS(NRZcBseZej�ZRS((R+R,RtMultiPolygonFieldRL(((sH/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/test_geoforms.pyRZ�sR?R0RL(
RR2RARKRDRJR4RCRNR%(RRZRR6RPRO((sH/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/test_geoforms.pyttest_multipolygonfield�s

;cCs�dtjfd��Y}|jd}|di|d6�}|j||j��|j|�|j|�j��xbg|jj�D]\}}|dkr�|^q�D],}|j|di|j	d6�j��q�WdS(NtGeometryFormcBseZej�ZRS((R+R,RtGeometryCollectionFieldtg(((sH/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/test_geoforms.pyR_�sR@R0Ra(
RR2RARKRDRJR4RCRNR%(RR_RR6RPRO((sH/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/test_geoforms.pyttest_geometrycollectionfield�s

;cCsldtjfd��Y}|jd}|di|d6�}|j�}|jd|�|jd|�dS(NR)cBseZejdej�ZRS(R*(R+R,RR-t	OSMWidgetRL(((sH/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/test_geoforms.pyR)sR8R0RLsOpenStreetMap (Mapnik)sid: 'id_p',(RR2RARDRE(RR)RR6RI((sH/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/test_geoforms.pyttest_osm_widgets
(
R+R,RBRJRKRQRSRWRYR\R^RbRd(((sH/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/test_geoforms.pyR:[s	5	
			
	
	
	
	
	
sBCustomGeometryWidgetTest needs gdal support and a spatial databasetCustomGeometryWidgetTestcBseZd�ZRS(csdtjfd��Y�dtjf�fd��Y}td�}|di|d6�}|jt|j�|j��d�_|j	dj
}|jt|j�|jd|j��|j|j
d	�|di|jd6�}|j|j��|j|jdjd
�dS(NtCustomGeometryWidgetcBs&eZdZdZd�Zd�ZRS(sgis/openlayers.htmlicSs|r
|jSdS(Nt(tjson(Rtvalue((sH/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/test_geoforms.pyt	serializescSs|jd7_t|�S(Ni(tdeserialize_calledR(RRi((sH/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/test_geoforms.pytdeserializes(R+R,t
template_nameRkRjRl(((sH/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/test_geoforms.pyRfs	R)cseZejd��ZRS(R*(R+R,RR-RL((Rf(sH/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/test_geoforms.pyR)ss)SRID=4326;POINT(9.052734375 42.451171875)R0RLiii�(RtBaseGeometryWidgetR2RRERRhRDtcalledR3R*trenderRRkRRCtcleaned_dataR(RR)R8R6R*((RfsH/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/test_geoforms.pyt test_custom_serialization_widgets
	((R+R,Rr(((sH/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/test_geoforms.pyRe
sN(tdjango.formsRtdjango.contrib.gis.gdalRtdjango.contrib.gis.tests.utilsRtdjango.testRtdjango.utilsRtdjango.utils.htmlRtdjango.utils.unittestRtdjango.contrib.gisRtdjango.contrib.gis.geosRR	R:Re(((sH/tmp/pip-install-XxeQeY/django/django/contrib/gis/tests/test_geoforms.pyt<module>s"M	�	

https://t.me/AnonymousX5 - 2025