umap-project 2.8.0__py3-none-any.whl → 2.8.0a0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- umap/__init__.py +1 -1
- umap/locale/en/LC_MESSAGES/django.po +13 -13
- umap/management/commands/empty_trash.py +2 -5
- umap/management/commands/migrate_to_S3.py +3 -3
- umap/settings/base.py +2 -2
- umap/static/umap/css/form.css +0 -3
- umap/static/umap/js/modules/data/features.js +4 -19
- umap/static/umap/js/modules/data/layer.js +19 -41
- umap/static/umap/js/modules/importer.js +20 -65
- umap/static/umap/js/modules/rendering/icon.js +1 -2
- umap/static/umap/js/modules/rendering/map.js +7 -7
- umap/static/umap/js/modules/rendering/popup.js +10 -9
- umap/static/umap/js/modules/rendering/template.js +9 -53
- umap/static/umap/js/modules/rendering/ui.js +2 -6
- umap/static/umap/js/modules/request.js +2 -2
- umap/static/umap/js/modules/schema.js +0 -1
- umap/static/umap/js/modules/ui/dialog.js +0 -5
- umap/static/umap/js/modules/umap.js +10 -33
- umap/static/umap/js/modules/utils.js +0 -2
- umap/static/umap/js/umap.controls.js +4 -7
- umap/static/umap/js/umap.forms.js +0 -44
- umap/static/umap/locale/en.js +1 -3
- umap/static/umap/locale/en.json +1 -3
- umap/static/umap/locale/fr.js +1 -3
- umap/static/umap/locale/fr.json +1 -3
- umap/static/umap/map.css +166 -34
- umap/static/umap/vars.css +1 -0
- umap/storage.py +216 -0
- umap/templates/base.html +0 -2
- umap/templates/umap/components/alerts/alert.html +0 -4
- umap/templates/umap/css.html +0 -3
- umap/templates/umap/js.html +0 -2
- umap/templates/umap/map_init.html +0 -2
- umap/templates/umap/user_dashboard.html +0 -2
- umap/tests/integration/test_edit_datalayer.py +0 -11
- umap/tests/integration/test_import.py +1 -20
- umap/tests/test_datalayer_s3.py +1 -1
- umap/tests/test_statics.py +1 -1
- umap/tests/test_team_views.py +1 -35
- umap/tests/test_views.py +74 -0
- umap/views.py +15 -20
- {umap_project-2.8.0.dist-info → umap_project-2.8.0a0.dist-info}/METADATA +1 -1
- {umap_project-2.8.0.dist-info → umap_project-2.8.0a0.dist-info}/RECORD +46 -52
- umap/settings/local_s3.py +0 -45
- umap/storage/__init__.py +0 -3
- umap/storage/fs.py +0 -101
- umap/storage/s3.py +0 -61
- umap/storage/staticfiles.py +0 -64
- umap/tests/fixtures/test_upload_simple_marker.json +0 -19
- umap/tests/test_dashboard.py +0 -82
- {umap_project-2.8.0.dist-info → umap_project-2.8.0a0.dist-info}/WHEEL +0 -0
- {umap_project-2.8.0.dist-info → umap_project-2.8.0a0.dist-info}/entry_points.txt +0 -0
- {umap_project-2.8.0.dist-info → umap_project-2.8.0a0.dist-info}/licenses/LICENSE +0 -0
umap/tests/test_dashboard.py
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import pytest
|
|
2
|
-
from django.contrib.auth import get_user_model
|
|
3
|
-
from django.urls import reverse
|
|
4
|
-
|
|
5
|
-
from umap.models import Map
|
|
6
|
-
|
|
7
|
-
from .base import MapFactory, UserFactory
|
|
8
|
-
|
|
9
|
-
User = get_user_model()
|
|
10
|
-
|
|
11
|
-
pytestmark = pytest.mark.django_db
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
def test_user_dashboard_is_restricted_to_logged_in(client):
|
|
15
|
-
response = client.get(reverse("user_dashboard"))
|
|
16
|
-
assert response.status_code == 302
|
|
17
|
-
assert response["Location"] == "/en/login/?next=/en/me"
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
def test_user_dashboard_display_user_maps(client, map):
|
|
21
|
-
client.login(username=map.owner.username, password="123123")
|
|
22
|
-
response = client.get(reverse("user_dashboard"))
|
|
23
|
-
assert response.status_code == 200
|
|
24
|
-
body = response.content.decode()
|
|
25
|
-
assert map.name in body
|
|
26
|
-
assert f"{map.get_absolute_url()}?edit" in body
|
|
27
|
-
assert f"{map.get_absolute_url()}?share" in body
|
|
28
|
-
assert f"/map/{map.pk}/download" in body
|
|
29
|
-
assert "Everyone (public)" in body
|
|
30
|
-
assert "Owner only" in body
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
def test_user_dashboard_do_not_display_blocked_user_maps(client, map):
|
|
34
|
-
map.share_status = Map.BLOCKED
|
|
35
|
-
map.save()
|
|
36
|
-
client.login(username=map.owner.username, password="123123")
|
|
37
|
-
response = client.get(reverse("user_dashboard"))
|
|
38
|
-
assert response.status_code == 200
|
|
39
|
-
body = response.content.decode()
|
|
40
|
-
assert map.name not in body
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
def test_user_dashboard_do_not_display_deleted_user_maps(client, map):
|
|
44
|
-
map.share_status = Map.DELETED
|
|
45
|
-
map.save()
|
|
46
|
-
client.login(username=map.owner.username, password="123123")
|
|
47
|
-
response = client.get(reverse("user_dashboard"))
|
|
48
|
-
assert response.status_code == 200
|
|
49
|
-
body = response.content.decode()
|
|
50
|
-
assert map.name not in body
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
@pytest.mark.parametrize("share_status", [Map.DRAFT, Map.PRIVATE, Map.PUBLIC, Map.OPEN])
|
|
54
|
-
def test_user_dashboard_display_user_team_maps(client, map, team, user, share_status):
|
|
55
|
-
user.teams.add(team)
|
|
56
|
-
user.save()
|
|
57
|
-
map.team = team
|
|
58
|
-
map.share_status = share_status
|
|
59
|
-
map.save()
|
|
60
|
-
assert map.owner != user
|
|
61
|
-
client.login(username=user.username, password="123123")
|
|
62
|
-
response = client.get(reverse("user_dashboard"))
|
|
63
|
-
assert response.status_code == 200
|
|
64
|
-
body = response.content.decode()
|
|
65
|
-
assert map.name in body
|
|
66
|
-
assert map.get_absolute_url() in body
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
def test_user_dashboard_display_user_maps_distinct(client, map):
|
|
70
|
-
# cf https://github.com/umap-project/umap/issues/1325
|
|
71
|
-
anonymap = MapFactory(name="Map witout owner should not appear")
|
|
72
|
-
user1 = UserFactory(username="user1")
|
|
73
|
-
user2 = UserFactory(username="user2")
|
|
74
|
-
map.editors.add(user1)
|
|
75
|
-
map.editors.add(user2)
|
|
76
|
-
map.save()
|
|
77
|
-
client.login(username=map.owner.username, password="123123")
|
|
78
|
-
response = client.get(reverse("user_dashboard"))
|
|
79
|
-
assert response.status_code == 200
|
|
80
|
-
body = response.content.decode()
|
|
81
|
-
assert body.count(f'<a href="/en/map/test-map_{map.pk}">test map</a>') == 1
|
|
82
|
-
assert body.count(anonymap.name) == 0
|
|
File without changes
|
|
File without changes
|
|
File without changes
|