Skip to content

Commit ff9d035

Browse files
ulgensnemesifier
authored andcommitted
[fix] Check html encoded versions of the given values in HTML widget test
1 parent 653e137 commit ff9d035

File tree

1 file changed

+3
-2
lines changed
  • tests/django_restframework_gis_tests

1 file changed

+3
-2
lines changed

tests/django_restframework_gis_tests/tests.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import json
66
import pickle
7+
from html import escape
78

89
from django.contrib.gis.geos import GEOSGeometry, Point
910
from django.core.exceptions import ImproperlyConfigured
@@ -528,8 +529,8 @@ def test_geojson_HTML_widget_value(self):
528529
self.geojson_location_list_url, headers={"accept": 'text/html'}
529530
)
530531
self.assertContains(response, '<textarea name="geometry"')
531-
self.assertContains(response, '"type": "Point"')
532-
self.assertContains(response, '"coordinates": [')
532+
self.assertContains(response, escape('"type": "Point"'))
533+
self.assertContains(response, escape('"coordinates": ['))
533534

534535
def test_patch_geojson_location(self):
535536
location = Location.objects.create(

0 commit comments

Comments
 (0)