udata 9.1.4__py2.py3-none-any.whl → 9.1.4.dev30973__py2.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.
Potentially problematic release.
This version of udata might be problematic. Click here for more details.
- tasks/__init__.py +2 -2
- udata/__init__.py +1 -1
- udata/api/__init__.py +3 -2
- udata/api/commands.py +1 -0
- udata/api/fields.py +1 -22
- udata/api_fields.py +37 -140
- udata/app.py +1 -1
- udata/auth/__init__.py +12 -8
- udata/commands/db.py +3 -3
- udata/commands/dcat.py +1 -1
- udata/commands/fixtures.py +40 -60
- udata/commands/purge.py +1 -2
- udata/commands/tests/test_fixtures.py +11 -44
- udata/core/activity/api.py +1 -14
- udata/core/activity/tasks.py +1 -1
- udata/core/badges/models.py +2 -6
- udata/core/contact_point/api.py +3 -1
- udata/core/dataservices/api.py +1 -37
- udata/core/dataservices/models.py +0 -38
- udata/core/dataservices/tasks.py +1 -1
- udata/core/dataset/events.py +1 -4
- udata/core/dataset/forms.py +2 -0
- udata/core/dataset/models.py +10 -12
- udata/core/dataset/rdf.py +1 -1
- udata/core/discussions/api.py +1 -1
- udata/core/discussions/models.py +2 -2
- udata/core/discussions/tasks.py +1 -1
- udata/core/metrics/models.py +1 -4
- udata/core/organization/api.py +7 -11
- udata/core/organization/api_fields.py +4 -10
- udata/core/organization/apiv2.py +1 -1
- udata/core/organization/csv.py +0 -1
- udata/core/organization/rdf.py +1 -4
- udata/core/owned.py +2 -4
- udata/core/post/api.py +2 -2
- udata/core/reuse/api.py +25 -32
- udata/core/reuse/api_fields.py +101 -2
- udata/core/reuse/apiv2.py +4 -4
- udata/core/reuse/forms.py +45 -0
- udata/core/reuse/models.py +16 -98
- udata/core/site/api.py +29 -3
- udata/core/spatial/commands.py +3 -3
- udata/core/spatial/factories.py +1 -1
- udata/core/spatial/forms.py +1 -1
- udata/core/spatial/models.py +2 -2
- udata/core/spatial/tests/test_models.py +1 -1
- udata/core/spatial/translations.py +1 -3
- udata/core/topic/api.py +2 -2
- udata/core/topic/apiv2.py +2 -1
- udata/core/user/api.py +8 -28
- udata/core/user/metrics.py +1 -1
- udata/cors.py +4 -4
- udata/features/transfer/api.py +2 -1
- udata/harvest/actions.py +1 -1
- udata/harvest/backends/__init__.py +1 -1
- udata/harvest/tasks.py +1 -0
- udata/harvest/tests/factories.py +2 -0
- udata/harvest/tests/test_base_backend.py +1 -0
- udata/harvest/tests/test_dcat_backend.py +17 -16
- udata/migrations/2020-07-24-remove-s-from-scope-oauth.py +1 -1
- udata/migrations/2021-07-05-remove-unused-badges.py +1 -0
- udata/migrations/2023-02-08-rename-internal-dates.py +2 -0
- udata/migrations/2024-06-11-fix-reuse-datasets-references.py +1 -0
- udata/mongo/datetime_fields.py +4 -11
- udata/mongo/document.py +0 -2
- udata/mongo/taglist_field.py +0 -26
- udata/search/commands.py +1 -1
- udata/search/query.py +1 -1
- udata/settings.py +0 -1
- udata/static/admin.js +36 -36
- udata/static/admin.js.map +1 -1
- udata/static/chunks/{12.576e63b7a990f8eab784.js → 12.5b900cac4417e10ef3a0.js} +2 -2
- udata/static/chunks/12.5b900cac4417e10ef3a0.js.map +1 -0
- udata/static/chunks/{28.1ef31a46255dc2bf56d1.js → 28.1759a7f57d526e6db574.js} +2 -2
- udata/static/chunks/28.1759a7f57d526e6db574.js.map +1 -0
- udata/static/common.js +1 -1
- udata/static/common.js.map +1 -1
- udata/tests/api/test_base_api.py +1 -1
- udata/tests/api/test_contact_points.py +4 -4
- udata/tests/api/test_dataservices_api.py +0 -59
- udata/tests/api/test_datasets_api.py +10 -10
- udata/tests/api/test_organizations_api.py +39 -39
- udata/tests/api/test_reuses_api.py +0 -49
- udata/tests/api/test_tags_api.py +4 -4
- udata/tests/api/test_transfer_api.py +1 -1
- udata/tests/api/test_user_api.py +0 -11
- udata/tests/apiv2/test_datasets.py +4 -4
- udata/tests/dataset/test_dataset_events.py +0 -28
- udata/tests/dataset/test_dataset_model.py +3 -3
- udata/tests/frontend/__init__.py +2 -0
- udata/tests/frontend/test_auth.py +1 -0
- udata/tests/organization/test_csv_adapter.py +2 -0
- udata/tests/organization/test_notifications.py +3 -3
- udata/tests/organization/test_organization_rdf.py +6 -31
- udata/tests/reuse/test_reuse_model.py +1 -0
- udata/tests/site/test_site_rdf.py +3 -1
- udata/tests/test_cors.py +3 -0
- udata/tests/test_owned.py +4 -4
- udata/tests/test_routing.py +1 -1
- udata/tests/test_tags.py +1 -1
- udata/tests/test_transfer.py +2 -1
- udata/tests/workers/test_jobs_commands.py +1 -1
- udata/utils.py +0 -12
- {udata-9.1.4.dist-info → udata-9.1.4.dev30973.dist-info}/METADATA +4 -16
- {udata-9.1.4.dist-info → udata-9.1.4.dev30973.dist-info}/RECORD +109 -109
- udata/static/chunks/12.576e63b7a990f8eab784.js.map +0 -1
- udata/static/chunks/28.1ef31a46255dc2bf56d1.js.map +0 -1
- udata/tests/api/test_activities_api.py +0 -69
- {udata-9.1.4.dist-info → udata-9.1.4.dev30973.dist-info}/LICENSE +0 -0
- {udata-9.1.4.dist-info → udata-9.1.4.dev30973.dist-info}/WHEEL +0 -0
- {udata-9.1.4.dist-info → udata-9.1.4.dev30973.dist-info}/entry_points.txt +0 -0
- {udata-9.1.4.dist-info → udata-9.1.4.dev30973.dist-info}/top_level.txt +0 -0
|
@@ -83,7 +83,7 @@ class DatasetResourceAPIV2Test(APITestCase):
|
|
|
83
83
|
assert data["total"] == len(resources)
|
|
84
84
|
assert data["page"] == 1
|
|
85
85
|
assert data["page_size"] == DEFAULT_PAGE_SIZE
|
|
86
|
-
assert data["next_page"]
|
|
86
|
+
assert data["next_page"] == None
|
|
87
87
|
assert data["previous_page"] is None
|
|
88
88
|
|
|
89
89
|
def test_get_missing_param(self):
|
|
@@ -97,7 +97,7 @@ class DatasetResourceAPIV2Test(APITestCase):
|
|
|
97
97
|
assert data["total"] == len(resources)
|
|
98
98
|
assert data["page"] == 1
|
|
99
99
|
assert data["page_size"] == DEFAULT_PAGE_SIZE
|
|
100
|
-
assert data["next_page"]
|
|
100
|
+
assert data["next_page"] == None
|
|
101
101
|
assert data["previous_page"] is None
|
|
102
102
|
|
|
103
103
|
def test_get_next_page(self):
|
|
@@ -129,7 +129,7 @@ class DatasetResourceAPIV2Test(APITestCase):
|
|
|
129
129
|
assert data["total"] == len(resources)
|
|
130
130
|
assert data["page"] == 2
|
|
131
131
|
assert data["page_size"] == DEFAULT_PAGE_SIZE
|
|
132
|
-
assert data["next_page"]
|
|
132
|
+
assert data["next_page"] == None
|
|
133
133
|
assert data["previous_page"] == url_for(
|
|
134
134
|
"apiv2.resources",
|
|
135
135
|
dataset=dataset.id,
|
|
@@ -196,7 +196,7 @@ class DatasetResourceAPIV2Test(APITestCase):
|
|
|
196
196
|
assert data["total"] == nb_resources__of_specific_type
|
|
197
197
|
assert data["page"] == 2
|
|
198
198
|
assert data["page_size"] == DEFAULT_PAGE_SIZE
|
|
199
|
-
assert data["next_page"]
|
|
199
|
+
assert data["next_page"] == None
|
|
200
200
|
assert data["previous_page"] == url_for(
|
|
201
201
|
"apiv2.resources",
|
|
202
202
|
dataset=dataset.id,
|
|
@@ -15,29 +15,6 @@ from udata.tests.helpers import assert_emit
|
|
|
15
15
|
@pytest.mark.usefixtures("enable_resource_event")
|
|
16
16
|
class DatasetEventsTest:
|
|
17
17
|
@patch("requests.post")
|
|
18
|
-
@pytest.mark.options(RESOURCES_ANALYSER_API_KEY=None)
|
|
19
|
-
def test_publish_message_resource_created_no_api_key(self, mock_req):
|
|
20
|
-
dataset = DatasetFactory()
|
|
21
|
-
resource = ResourceFactory()
|
|
22
|
-
expected_signals = (Dataset.on_resource_added,)
|
|
23
|
-
|
|
24
|
-
with assert_emit(*expected_signals):
|
|
25
|
-
dataset.add_resource(resource)
|
|
26
|
-
|
|
27
|
-
expected_value = {
|
|
28
|
-
"resource_id": str(resource.id),
|
|
29
|
-
"dataset_id": str(dataset.id),
|
|
30
|
-
"document": serialize_resource_for_event(resource),
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
mock_req.assert_called_with(
|
|
34
|
-
f"{current_app.config['RESOURCES_ANALYSER_URI']}/api/resource/created/",
|
|
35
|
-
json=expected_value,
|
|
36
|
-
headers={}, # No RESOURCES_ANALYSER_API_KEY, no headers.
|
|
37
|
-
)
|
|
38
|
-
|
|
39
|
-
@patch("requests.post")
|
|
40
|
-
@pytest.mark.options(RESOURCES_ANALYSER_API_KEY="foobar-api-key")
|
|
41
18
|
def test_publish_message_resource_created(self, mock_req):
|
|
42
19
|
dataset = DatasetFactory()
|
|
43
20
|
resource = ResourceFactory()
|
|
@@ -55,11 +32,9 @@ class DatasetEventsTest:
|
|
|
55
32
|
mock_req.assert_called_with(
|
|
56
33
|
f"{current_app.config['RESOURCES_ANALYSER_URI']}/api/resource/created/",
|
|
57
34
|
json=expected_value,
|
|
58
|
-
headers={"Authorization": "Bearer foobar-api-key"},
|
|
59
35
|
)
|
|
60
36
|
|
|
61
37
|
@patch("requests.post")
|
|
62
|
-
@pytest.mark.options(RESOURCES_ANALYSER_API_KEY="foobar-api-key")
|
|
63
38
|
def test_publish_message_resource_modified(self, mock_req):
|
|
64
39
|
resource = ResourceFactory(schema=Schema(url="http://localhost/my-schema"))
|
|
65
40
|
dataset = DatasetFactory(resources=[resource])
|
|
@@ -79,7 +54,6 @@ class DatasetEventsTest:
|
|
|
79
54
|
mock_req.assert_called_with(
|
|
80
55
|
f"{current_app.config['RESOURCES_ANALYSER_URI']}/api/resource/updated/",
|
|
81
56
|
json=expected_value,
|
|
82
|
-
headers={"Authorization": "Bearer foobar-api-key"},
|
|
83
57
|
)
|
|
84
58
|
|
|
85
59
|
# Mocking requests call doesn't call the JSON encoder
|
|
@@ -88,7 +62,6 @@ class DatasetEventsTest:
|
|
|
88
62
|
complexjson.dumps(expected_value)
|
|
89
63
|
|
|
90
64
|
@patch("requests.post")
|
|
91
|
-
@pytest.mark.options(RESOURCES_ANALYSER_API_KEY="foobar-api-key")
|
|
92
65
|
def test_publish_message_resource_removed(self, mock_req):
|
|
93
66
|
resource = ResourceFactory()
|
|
94
67
|
dataset = DatasetFactory(resources=[resource])
|
|
@@ -106,5 +79,4 @@ class DatasetEventsTest:
|
|
|
106
79
|
mock_req.assert_called_with(
|
|
107
80
|
f"{current_app.config['RESOURCES_ANALYSER_URI']}/api/resource/deleted/",
|
|
108
81
|
json=expected_value,
|
|
109
|
-
headers={"Authorization": "Bearer foobar-api-key"},
|
|
110
82
|
)
|
|
@@ -301,15 +301,15 @@ class DatasetModelTest:
|
|
|
301
301
|
|
|
302
302
|
def test_dataset_without_private(self):
|
|
303
303
|
dataset = DatasetFactory()
|
|
304
|
-
assert dataset.private
|
|
304
|
+
assert dataset.private == False
|
|
305
305
|
|
|
306
306
|
dataset.private = None
|
|
307
307
|
dataset.save()
|
|
308
|
-
assert dataset.private
|
|
308
|
+
assert dataset.private == False
|
|
309
309
|
|
|
310
310
|
dataset.private = True
|
|
311
311
|
dataset.save()
|
|
312
|
-
assert dataset.private
|
|
312
|
+
assert dataset.private == True
|
|
313
313
|
|
|
314
314
|
|
|
315
315
|
class ResourceModelTest:
|
udata/tests/frontend/__init__.py
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import pytest
|
|
2
2
|
|
|
3
|
+
from udata.core.dataset.csv import DatasetCsvAdapter, ResourcesCsvAdapter
|
|
3
4
|
from udata.core.dataset.factories import DatasetFactory, ResourceFactory
|
|
5
|
+
from udata.core.dataset.models import Dataset
|
|
4
6
|
from udata.core.organization.csv import OrganizationCsvAdapter
|
|
5
7
|
from udata.core.organization.factories import OrganizationFactory
|
|
6
8
|
from udata.core.organization.models import Organization
|
|
@@ -17,11 +17,11 @@ class OrganizationNotificationsTest:
|
|
|
17
17
|
members = [Member(user=editor, role="editor"), Member(user=admin, role="admin")]
|
|
18
18
|
org = OrganizationFactory(members=members, requests=[request])
|
|
19
19
|
|
|
20
|
-
assert len(membership_request_notifications(applicant))
|
|
21
|
-
assert len(membership_request_notifications(editor))
|
|
20
|
+
assert len(membership_request_notifications(applicant)) is 0
|
|
21
|
+
assert len(membership_request_notifications(editor)) is 0
|
|
22
22
|
|
|
23
23
|
notifications = membership_request_notifications(admin)
|
|
24
|
-
assert len(notifications)
|
|
24
|
+
assert len(notifications) is 1
|
|
25
25
|
dt, details = notifications[0]
|
|
26
26
|
assert_equal_dates(dt, request.created)
|
|
27
27
|
assert details["id"] == request.id
|
|
@@ -4,8 +4,6 @@ from rdflib.namespace import FOAF, RDF, RDFS
|
|
|
4
4
|
from rdflib.resource import Resource as RdfResource
|
|
5
5
|
|
|
6
6
|
from udata import api
|
|
7
|
-
from udata.core.dataservices.factories import DataserviceFactory
|
|
8
|
-
from udata.core.dataservices.models import Dataservice
|
|
9
7
|
from udata.core.dataset.factories import DatasetFactory
|
|
10
8
|
from udata.core.dataset.models import Dataset
|
|
11
9
|
from udata.core.organization.factories import OrganizationFactory
|
|
@@ -57,8 +55,7 @@ class OrganizationToRdfTest(DBTestMixin, TestCase):
|
|
|
57
55
|
uri = url_for("api.organization_rdf", org=origin_org.id, _external=True)
|
|
58
56
|
|
|
59
57
|
datasets = DatasetFactory.create_batch(3, organization=origin_org)
|
|
60
|
-
|
|
61
|
-
catalog = build_org_catalog(origin_org, datasets, dataservices)
|
|
58
|
+
catalog = build_org_catalog(origin_org, datasets)
|
|
62
59
|
|
|
63
60
|
graph = catalog.graph
|
|
64
61
|
|
|
@@ -72,7 +69,6 @@ class OrganizationToRdfTest(DBTestMixin, TestCase):
|
|
|
72
69
|
self.assertEqual(str(catalog.identifier), uri)
|
|
73
70
|
|
|
74
71
|
self.assertEqual(len(list(catalog.objects(DCAT.dataset))), len(datasets))
|
|
75
|
-
self.assertEqual(len(list(catalog.objects(DCAT.dataservice))), len(dataservices))
|
|
76
72
|
|
|
77
73
|
org = catalog.value(DCT.publisher)
|
|
78
74
|
self.assertEqual(org.value(RDF.type).identifier, FOAF.Organization)
|
|
@@ -84,8 +80,6 @@ class OrganizationToRdfTest(DBTestMixin, TestCase):
|
|
|
84
80
|
graph = catalog.graph
|
|
85
81
|
graph_datasets = graph.subjects(RDF.type, DCAT.Dataset)
|
|
86
82
|
self.assertEqual(len(list(graph_datasets)), len(datasets))
|
|
87
|
-
graph_dataservices = graph.subjects(RDF.type, DCAT.DataService)
|
|
88
|
-
self.assertEqual(len(list(graph_dataservices)), len(dataservices))
|
|
89
83
|
|
|
90
84
|
def test_catalog_pagination(self):
|
|
91
85
|
origin_org = OrganizationFactory()
|
|
@@ -108,23 +102,11 @@ class OrganizationToRdfTest(DBTestMixin, TestCase):
|
|
|
108
102
|
page_size=page_size,
|
|
109
103
|
_external=True,
|
|
110
104
|
)
|
|
111
|
-
# First create a dataset and it's associated dataservice, which should be listed
|
|
112
|
-
# last, and thus on the second page.
|
|
113
|
-
extra_dataset = DatasetFactory.create(organization=origin_org)
|
|
114
|
-
_extra_dataservice = DataserviceFactory.create(
|
|
115
|
-
datasets=[extra_dataset], organization=origin_org
|
|
116
|
-
)
|
|
117
|
-
|
|
118
|
-
# Create `total` datasets that should be listed on the first page up to `page_size`
|
|
119
105
|
DatasetFactory.create_batch(total, organization=origin_org)
|
|
120
|
-
# And all the dataservices with no datasets, which will all be listed on the first page.
|
|
121
|
-
# See DataserviceQuerySet.filter_by_dataset_pagination.
|
|
122
|
-
DataserviceFactory.create_batch(total, organization=origin_org)
|
|
123
106
|
|
|
124
107
|
# First page
|
|
125
108
|
datasets = Dataset.objects.paginate(1, page_size)
|
|
126
|
-
|
|
127
|
-
catalog = build_org_catalog(origin_org, datasets, dataservices, format="json")
|
|
109
|
+
catalog = build_org_catalog(origin_org, datasets, format="json")
|
|
128
110
|
graph = catalog.graph
|
|
129
111
|
|
|
130
112
|
self.assertIsInstance(catalog, RdfResource)
|
|
@@ -133,12 +115,9 @@ class OrganizationToRdfTest(DBTestMixin, TestCase):
|
|
|
133
115
|
self.assertIn(DCAT.Catalog, types)
|
|
134
116
|
self.assertIn(HYDRA.Collection, types)
|
|
135
117
|
|
|
136
|
-
self.assertEqual(catalog.value(HYDRA.totalItems), Literal(total
|
|
118
|
+
self.assertEqual(catalog.value(HYDRA.totalItems), Literal(total))
|
|
137
119
|
|
|
138
120
|
self.assertEqual(len(list(catalog.objects(DCAT.dataset))), page_size)
|
|
139
|
-
# All dataservices that are not linked to a dataset are listed in the first page.
|
|
140
|
-
# See DataserviceQuerySet.filter_by_dataset_pagination.
|
|
141
|
-
self.assertEqual(len(list(catalog.objects(DCAT.dataservice))), total)
|
|
142
121
|
|
|
143
122
|
paginations = list(graph.subjects(RDF.type, HYDRA.PartialCollectionView))
|
|
144
123
|
self.assertEqual(len(paginations), 1)
|
|
@@ -151,8 +130,7 @@ class OrganizationToRdfTest(DBTestMixin, TestCase):
|
|
|
151
130
|
|
|
152
131
|
# Second page
|
|
153
132
|
datasets = Dataset.objects.paginate(2, page_size)
|
|
154
|
-
|
|
155
|
-
catalog = build_org_catalog(origin_org, datasets, dataservices, format="json")
|
|
133
|
+
catalog = build_org_catalog(origin_org, datasets, format="json")
|
|
156
134
|
graph = catalog.graph
|
|
157
135
|
|
|
158
136
|
self.assertIsInstance(catalog, RdfResource)
|
|
@@ -161,12 +139,9 @@ class OrganizationToRdfTest(DBTestMixin, TestCase):
|
|
|
161
139
|
self.assertIn(DCAT.Catalog, types)
|
|
162
140
|
self.assertIn(HYDRA.Collection, types)
|
|
163
141
|
|
|
164
|
-
self.assertEqual(catalog.value(HYDRA.totalItems), Literal(total
|
|
142
|
+
self.assertEqual(catalog.value(HYDRA.totalItems), Literal(total))
|
|
165
143
|
|
|
166
|
-
|
|
167
|
-
self.assertEqual(len(list(catalog.objects(DCAT.dataset))), 2)
|
|
168
|
-
# 1 extra_dataservice, listed on the same page as its associated extra_dataset.
|
|
169
|
-
self.assertEqual(len(list(catalog.objects(DCAT.dataservice))), 1)
|
|
144
|
+
self.assertEqual(len(list(catalog.objects(DCAT.dataset))), 1)
|
|
170
145
|
|
|
171
146
|
paginations = list(graph.subjects(RDF.type, HYDRA.PartialCollectionView))
|
|
172
147
|
self.assertEqual(len(paginations), 1)
|
|
@@ -254,7 +254,9 @@ class SiteRdfViewsTest:
|
|
|
254
254
|
dataset_b = DatasetFactory.create()
|
|
255
255
|
dataset_c = DatasetFactory.create()
|
|
256
256
|
|
|
257
|
-
DataserviceFactory.create(
|
|
257
|
+
dataservice_a = DataserviceFactory.create(
|
|
258
|
+
datasets=[dataset_a.id], harvest=HarvestMetadataFactory()
|
|
259
|
+
)
|
|
258
260
|
dataservice_b = DataserviceFactory.create(datasets=[dataset_b.id])
|
|
259
261
|
dataservice_x = DataserviceFactory.create(datasets=[dataset_a.id, dataset_c.id])
|
|
260
262
|
dataservice_y = DataserviceFactory.create(datasets=[])
|
udata/tests/test_cors.py
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
from datetime import datetime
|
|
2
2
|
|
|
3
|
+
import pytest
|
|
3
4
|
from flask import url_for
|
|
4
5
|
|
|
5
6
|
from udata.core.dataset.factories import DatasetFactory
|
|
7
|
+
from udata.core.topic.factories import TopicFactory
|
|
8
|
+
from udata.search import reindex
|
|
6
9
|
from udata.tests.api import APITestCase
|
|
7
10
|
from udata.tests.helpers import assert_status
|
|
8
11
|
|
udata/tests/test_owned.py
CHANGED
|
@@ -161,8 +161,8 @@ class OwnedQuerysetTest(DBTestMixin, TestCase):
|
|
|
161
161
|
result = Owned.objects.owned_by(org, user)
|
|
162
162
|
|
|
163
163
|
self.assertEqual(len(result), 2)
|
|
164
|
-
for
|
|
165
|
-
self.assertIn(
|
|
164
|
+
for owned in result:
|
|
165
|
+
self.assertIn(owned, owneds)
|
|
166
166
|
|
|
167
|
-
for
|
|
168
|
-
self.assertNotIn(
|
|
167
|
+
for owned in excluded:
|
|
168
|
+
self.assertNotIn(owned, result)
|
udata/tests/test_routing.py
CHANGED
|
@@ -273,7 +273,7 @@ class SlugAsSLugFieldWithFollowTest(AsSlugMixin):
|
|
|
273
273
|
assert404(client.get(second_url))
|
|
274
274
|
assert404(client.get(last_url))
|
|
275
275
|
|
|
276
|
-
assert SlugFollow.objects.count()
|
|
276
|
+
assert SlugFollow.objects.count() is 0
|
|
277
277
|
|
|
278
278
|
|
|
279
279
|
@pytest.mark.usefixtures("clean_db")
|
udata/tests/test_tags.py
CHANGED
|
@@ -38,7 +38,7 @@ class TagsTests:
|
|
|
38
38
|
rows = list(reader)
|
|
39
39
|
|
|
40
40
|
assert header == ["name", "datasets", "reuses", "total"]
|
|
41
|
-
assert len(rows)
|
|
41
|
+
assert len(rows) is 3
|
|
42
42
|
assert rows[0] == ["both", "15", "10", "25"]
|
|
43
43
|
assert rows[1] == ["datasets-only", "15", "0", "15"]
|
|
44
44
|
assert rows[2] == ["reuses-only", "0", "10", "10"]
|
udata/tests/test_transfer.py
CHANGED
|
@@ -13,7 +13,8 @@ from udata.core.user.metrics import (
|
|
|
13
13
|
from udata.features.transfer.actions import accept_transfer, request_transfer
|
|
14
14
|
from udata.features.transfer.factories import TransferFactory
|
|
15
15
|
from udata.features.transfer.notifications import transfer_request_notifications
|
|
16
|
-
from udata.models import Member
|
|
16
|
+
from udata.models import Dataset, Member
|
|
17
|
+
from udata.tests.helpers import assert_emit
|
|
17
18
|
from udata.utils import faker
|
|
18
19
|
|
|
19
20
|
pytestmark = pytest.mark.usefixtures("clean_db")
|
|
@@ -101,7 +101,7 @@ class JobsCommandsTest:
|
|
|
101
101
|
]
|
|
102
102
|
result = cli("job scheduled")
|
|
103
103
|
|
|
104
|
-
filtered = [
|
|
104
|
+
filtered = [l for l in result.output.splitlines() if "Tip" not in l]
|
|
105
105
|
assert len(filtered) == len(tasks)
|
|
106
106
|
|
|
107
107
|
assert "not-scheduled" not in result.output
|
udata/utils.py
CHANGED
|
@@ -18,8 +18,6 @@ from faker.providers import BaseProvider
|
|
|
18
18
|
from faker.providers.lorem.la import Provider as LoremProvider
|
|
19
19
|
from flask import abort
|
|
20
20
|
|
|
21
|
-
from udata import tags
|
|
22
|
-
|
|
23
21
|
|
|
24
22
|
def get_by(lst, field, value):
|
|
25
23
|
"""Find an object in a list given a field value"""
|
|
@@ -279,16 +277,6 @@ PROVIDERS.remove("faker.providers.lorem")
|
|
|
279
277
|
faker = Faker("fr_FR") # Use a unicode/utf-8 based locale
|
|
280
278
|
|
|
281
279
|
|
|
282
|
-
def tag() -> str:
|
|
283
|
-
fake_tag: str = faker.word()
|
|
284
|
-
while len(fake_tag) < tags.MIN_TAG_LENGTH:
|
|
285
|
-
fake_tag = faker.word()
|
|
286
|
-
return fake_tag
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
faker.tag = tag
|
|
290
|
-
|
|
291
|
-
|
|
292
280
|
def faker_provider(provider):
|
|
293
281
|
faker.add_provider(provider)
|
|
294
282
|
factory.Faker.add_provider(provider)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: udata
|
|
3
|
-
Version: 9.1.4
|
|
3
|
+
Version: 9.1.4.dev30973
|
|
4
4
|
Summary: Open data portal
|
|
5
5
|
Home-page: https://github.com/opendatateam/udata
|
|
6
6
|
Author: Opendata Team
|
|
@@ -138,20 +138,9 @@ It is collectively taken care of by members of the
|
|
|
138
138
|
|
|
139
139
|
# Changelog
|
|
140
140
|
|
|
141
|
-
##
|
|
142
|
-
|
|
143
|
-
-
|
|
144
|
-
- Import the dataservice's organization from the fixtures [#3121](https://github.com/opendatateam/udata/pull/3121)
|
|
145
|
-
- Convert reuse to new API system [#3066](https://github.com/opendatateam/udata/pull/3066)
|
|
146
|
-
- Fix circular import error [#3128](https://github.com/opendatateam/udata/pull/3128)
|
|
147
|
-
- Add an option to specify the port when using `inv serve` [#3123](https://github.com/opendatateam/udata/pull/3123)
|
|
148
|
-
- Add a new `related_to` filter parameter to the activities API endpoint [#3127](https://github.com/opendatateam/udata/pull/3127)
|
|
149
|
-
- Properly import the `Discussion.closed_by` from the fixtures [#3125](https://github.com/opendatateam/udata/pull/3125)
|
|
150
|
-
- Send an API token to Hydra when publishing resource events [#3130](https://github.com/opendatateam/udata/pull/3130)
|
|
151
|
-
- Add `last_login_at` to org members API [#3133](https://github.com/opendatateam/udata/pull/3133)
|
|
152
|
-
- Always add Vary even for non CORS requests [#3132](https://github.com/opendatateam/udata/pull/3132)
|
|
153
|
-
- Add acronym in organization csv catalog [#3134](https://github.com/opendatateam/udata/pull/3134)
|
|
154
|
-
- Limit the number of user suggestions [#3131](https://github.com/opendatateam/udata/pull/3131)
|
|
141
|
+
## Current (in progress)
|
|
142
|
+
|
|
143
|
+
- Nothing yet
|
|
155
144
|
|
|
156
145
|
## 9.1.3 (2024-08-01)
|
|
157
146
|
|
|
@@ -161,7 +150,6 @@ It is collectively taken care of by members of the
|
|
|
161
150
|
- Update to the version v2.0.0 of udata-fixtures (with the dataservices)
|
|
162
151
|
- Add type hints [#3111](https://github.com/opendatateam/udata/pull/3111)
|
|
163
152
|
- Make sure requests v2.32.3 is used everywhere consistently [#3116](https://github.com/opendatateam/udata/pull/3116)
|
|
164
|
-
- Expose a dataservice in its organization's catalog, and expose a dataservice's catalog [#3122](https://github.com/opendatateam/udata/pull/3122)
|
|
165
153
|
|
|
166
154
|
## 9.1.2 (2024-07-29)
|
|
167
155
|
|