Skip to content

Commit

Permalink
Merge pull request #4033 from GeotrekCE/upgrade_mapentity
Browse files Browse the repository at this point in the history
bump to mapentity 8.7.3
  • Loading branch information
submarcos committed Apr 3, 2024
2 parents 6175d94 + e17d554 commit a053c09
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 1 deletion.
4 changes: 4 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ This version breaks the flat pages API. Upgrade first to Geotrek-rando 3.19.0 (s

- Add git to Dockerfile build staging

**Maintenance**

- Bump mapentity from 8.7.2 to 8.7.3

**Documentation**

- Add documentation about new ``MAX_CHARACTERS_BY_FIELD`` setting, replacing deprecated ``MAX_CHARACTERS`` (#3844)
Expand Down
19 changes: 19 additions & 0 deletions geotrek/common/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,25 @@ def test_document_public_booklet_export(self, mock_requests):
kwargs={'lang': 'en', 'pk': obj.pk, 'slug': obj.slug}))
self.assertEqual(response.status_code, 200)

@mock.patch('mapentity.helpers.requests')
def test_document_markup(self, mock_requests):
if self.model is None:
return # Abstract test should not run
try:
reverse(f'{self.model._meta.app_label}:{self.model._meta.model_name}_markup_html',
kwargs={'lang': 'en', 'pk': 0, 'slug': 'test'})
except NoReverseMatch:
return # No document markup

mock_requests.get.return_value.status_code = 200
mock_requests.get.return_value.content = b'<p id="properties">Mock</p>'

obj = self.modelfactory.create()
response = self.client.get(
reverse(f"{self.model._meta.app_label}:{self.model._meta.model_name}_markup_html",
kwargs={'pk': obj.pk, 'slug': obj.slug, 'lang': 'en'}))
self.assertEqual(response.status_code, 200)

@mock.patch('mapentity.helpers.requests')
def test_duplicate_object_without_structure(self, mock_requests):
if self.model is None or not getattr(self.model, 'can_duplicate') or hasattr(self.model, 'structure'):
Expand Down
1 change: 1 addition & 0 deletions geotrek/common/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ def scan_views(self, *args, **kwargs):
name=self.modelname
),
self.markup_public_view.as_view(model=self.model),
name="%s_markup_html" % self.modelname,
),
]
return publishable_views + mapentity_views
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ lxml==4.9.3
# via
# mapentity
# svglib
mapentity==8.7.2
mapentity==8.7.3
# via geotrek (setup.py)
markdown==3.4.4
# via geotrek (setup.py)
Expand Down

0 comments on commit a053c09

Please sign in to comment.