Skip to content

Commit

Permalink
[fix] Check html encoded versions of the given values in HTML widget …
Browse files Browse the repository at this point in the history
…test
  • Loading branch information
ulgens committed Nov 23, 2024
1 parent e6b4812 commit 111c00a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/django_restframework_gis_tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import json
import pickle
from html import escape

from django.contrib.gis.geos import GEOSGeometry, Point
from django.core.exceptions import ImproperlyConfigured
Expand Down Expand Up @@ -528,8 +529,8 @@ def test_geojson_HTML_widget_value(self):
self.geojson_location_list_url, headers={"accept": 'text/html'}
)
self.assertContains(response, '<textarea name="geometry"')
self.assertContains(response, '"type": "Point"')
self.assertContains(response, '"coordinates": [')
self.assertContains(response, escape('"type": "Point"'))
self.assertContains(response, escape('"coordinates": ['))

def test_patch_geojson_location(self):
location = Location.objects.create(
Expand Down

0 comments on commit 111c00a

Please sign in to comment.