Skip to content

Commit

Permalink
Ad dunit test for trek with no url
Browse files Browse the repository at this point in the history
  • Loading branch information
justinefricou committed Nov 6, 2024
1 parent 6c4365d commit 368fa3e
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
23 changes: 23 additions & 0 deletions geotrek/trekking/tests/data/trek_schema_parser/no_url.geojson
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"type": "FeatureCollection",
"name": "sql_statement",
"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } },
"features": [
{
"type": "Feature",
"properties": {
"id_local": "1",
"producteur": "Producer 1",
"nom_itineraire": "Trek 1",
"pratique": "pédestre",
"depart": "Departure 1",
"arrivee": "Arrival 1",
"instructions": "Instructions 1"
},
"geometry": {
"type": "LineString",
"coordinates": [ [ 6.449592517966364, 44.733424655086957 ], [ 6.449539623508488, 44.733394939411369 ] ]
}
}
]
}
7 changes: 4 additions & 3 deletions geotrek/trekking/tests/test_parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1861,6 +1861,7 @@ def test_incorrect_parking_location(self):
self.assertIn("Bad value for parking geometry: should be a Point", output.getvalue())

def test_no_url(self):
...
# TODO:
# - no url
self.call_import_command_with_file('no_url.geojson')
self.assertEqual(Trek.objects.count(), 1)
trek = Trek.objects.get()
self.assertEqual(trek.description, 'Instructions 1')

0 comments on commit 368fa3e

Please sign in to comment.