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.
Files changed (53) hide show
  1. umap/__init__.py +1 -1
  2. umap/locale/en/LC_MESSAGES/django.po +13 -13
  3. umap/management/commands/empty_trash.py +2 -5
  4. umap/management/commands/migrate_to_S3.py +3 -3
  5. umap/settings/base.py +2 -2
  6. umap/static/umap/css/form.css +0 -3
  7. umap/static/umap/js/modules/data/features.js +4 -19
  8. umap/static/umap/js/modules/data/layer.js +19 -41
  9. umap/static/umap/js/modules/importer.js +20 -65
  10. umap/static/umap/js/modules/rendering/icon.js +1 -2
  11. umap/static/umap/js/modules/rendering/map.js +7 -7
  12. umap/static/umap/js/modules/rendering/popup.js +10 -9
  13. umap/static/umap/js/modules/rendering/template.js +9 -53
  14. umap/static/umap/js/modules/rendering/ui.js +2 -6
  15. umap/static/umap/js/modules/request.js +2 -2
  16. umap/static/umap/js/modules/schema.js +0 -1
  17. umap/static/umap/js/modules/ui/dialog.js +0 -5
  18. umap/static/umap/js/modules/umap.js +10 -33
  19. umap/static/umap/js/modules/utils.js +0 -2
  20. umap/static/umap/js/umap.controls.js +4 -7
  21. umap/static/umap/js/umap.forms.js +0 -44
  22. umap/static/umap/locale/en.js +1 -3
  23. umap/static/umap/locale/en.json +1 -3
  24. umap/static/umap/locale/fr.js +1 -3
  25. umap/static/umap/locale/fr.json +1 -3
  26. umap/static/umap/map.css +166 -34
  27. umap/static/umap/vars.css +1 -0
  28. umap/storage.py +216 -0
  29. umap/templates/base.html +0 -2
  30. umap/templates/umap/components/alerts/alert.html +0 -4
  31. umap/templates/umap/css.html +0 -3
  32. umap/templates/umap/js.html +0 -2
  33. umap/templates/umap/map_init.html +0 -2
  34. umap/templates/umap/user_dashboard.html +0 -2
  35. umap/tests/integration/test_edit_datalayer.py +0 -11
  36. umap/tests/integration/test_import.py +1 -20
  37. umap/tests/test_datalayer_s3.py +1 -1
  38. umap/tests/test_statics.py +1 -1
  39. umap/tests/test_team_views.py +1 -35
  40. umap/tests/test_views.py +74 -0
  41. umap/views.py +15 -20
  42. {umap_project-2.8.0.dist-info → umap_project-2.8.0a0.dist-info}/METADATA +1 -1
  43. {umap_project-2.8.0.dist-info → umap_project-2.8.0a0.dist-info}/RECORD +46 -52
  44. umap/settings/local_s3.py +0 -45
  45. umap/storage/__init__.py +0 -3
  46. umap/storage/fs.py +0 -101
  47. umap/storage/s3.py +0 -61
  48. umap/storage/staticfiles.py +0 -64
  49. umap/tests/fixtures/test_upload_simple_marker.json +0 -19
  50. umap/tests/test_dashboard.py +0 -82
  51. {umap_project-2.8.0.dist-info → umap_project-2.8.0a0.dist-info}/WHEEL +0 -0
  52. {umap_project-2.8.0.dist-info → umap_project-2.8.0a0.dist-info}/entry_points.txt +0 -0
  53. {umap_project-2.8.0.dist-info → umap_project-2.8.0a0.dist-info}/licenses/LICENSE +0 -0
@@ -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