mirror of
https://github.com/umap-project/umap.git
synced 2025-04-29 03:42:37 +02:00
parent
2ca6ffd5ca
commit
97d2ebae34
2 changed files with 16 additions and 1 deletions
|
@ -17,7 +17,7 @@
|
|||
{% umap_css %}
|
||||
{{ block.super }}
|
||||
{% umap_js locale=locale %}
|
||||
{% if object.share_status != object.PUBLIC %}
|
||||
{% if UMAP_DEMO_SITE or object.share_status != object.PUBLIC %}
|
||||
<meta name="robots" content="noindex">
|
||||
{% endif %}
|
||||
<link rel="alternate"
|
||||
|
|
|
@ -861,3 +861,18 @@ def test_ogp_links(client, map, datalayer):
|
|||
assert f'<meta property="og:title" content="{map.name}" />' in content
|
||||
assert f'<meta property="og:description" content="{map.description}" />' in content
|
||||
assert '<meta property="og:site_name" content="uMap" />' in content
|
||||
|
||||
|
||||
def test_non_public_map_should_have_noindex_meta(client, map, datalayer):
|
||||
map.share_status = Map.OPEN
|
||||
map.save()
|
||||
response = client.get(map.get_absolute_url())
|
||||
assert response.status_code == 200
|
||||
assert '<meta name="robots" content="noindex">' in response.content.decode()
|
||||
|
||||
|
||||
def test_demo_instance_should_have_noindex(client, map, datalayer, settings):
|
||||
settings.UMAP_DEMO_SITE = True
|
||||
response = client.get(map.get_absolute_url())
|
||||
assert response.status_code == 200
|
||||
assert '<meta name="robots" content="noindex">' in response.content.decode()
|
||||
|
|
Loading…
Reference in a new issue