imio.smartweb.core 1.2.51__py3-none-any.whl → 1.2.52__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.
- imio/smartweb/core/browser/vocabulary.py +3 -2
- imio/smartweb/core/tests/test_vocabulary.py +43 -0
- {imio.smartweb.core-1.2.51.dist-info → imio.smartweb.core-1.2.52.dist-info}/METADATA +9 -1
- {imio.smartweb.core-1.2.51.dist-info → imio.smartweb.core-1.2.52.dist-info}/RECORD +10 -9
- /imio.smartweb.core-1.2.51-py3.8-nspkg.pth → /imio.smartweb.core-1.2.52-py3.11-nspkg.pth +0 -0
- {imio.smartweb.core-1.2.51.dist-info → imio.smartweb.core-1.2.52.dist-info}/LICENSE.GPL +0 -0
- {imio.smartweb.core-1.2.51.dist-info → imio.smartweb.core-1.2.52.dist-info}/LICENSE.rst +0 -0
- {imio.smartweb.core-1.2.51.dist-info → imio.smartweb.core-1.2.52.dist-info}/WHEEL +0 -0
- {imio.smartweb.core-1.2.51.dist-info → imio.smartweb.core-1.2.52.dist-info}/namespace_packages.txt +0 -0
- {imio.smartweb.core-1.2.51.dist-info → imio.smartweb.core-1.2.52.dist-info}/top_level.txt +0 -0
@@ -1,10 +1,11 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
|
-
|
2
|
+
|
3
|
+
from imio.smartweb.common.browser.vocabulary import TranslatedVocabularyView
|
3
4
|
from plone.app.content.browser.vocabulary import VocabLookupException
|
4
5
|
from plone.app.content.utils import json_dumps
|
5
6
|
|
6
7
|
|
7
|
-
class SmartwebVocabularyView(
|
8
|
+
class SmartwebVocabularyView(TranslatedVocabularyView):
|
8
9
|
|
9
10
|
def __call__(self):
|
10
11
|
form = self.request.form
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
|
3
|
+
from imio.smartweb.core.testing import IMIO_SMARTWEB_CORE_INTEGRATION_TESTING
|
4
|
+
from imio.smartweb.core.testing import ImioSmartwebTestCase
|
5
|
+
from plone import api
|
6
|
+
from plone.app.testing import setRoles
|
7
|
+
from plone.app.testing import TEST_USER_ID
|
8
|
+
from unittest.mock import patch
|
9
|
+
from zope.component import queryMultiAdapter
|
10
|
+
|
11
|
+
import json
|
12
|
+
|
13
|
+
|
14
|
+
class TestVocabulary(ImioSmartwebTestCase):
|
15
|
+
layer = IMIO_SMARTWEB_CORE_INTEGRATION_TESTING
|
16
|
+
|
17
|
+
def setUp(self):
|
18
|
+
"""Custom shared utility setup for tests"""
|
19
|
+
self.request = self.layer["request"]
|
20
|
+
self.portal = self.layer["portal"]
|
21
|
+
setRoles(self.portal, TEST_USER_ID, ["Manager"])
|
22
|
+
self.page = api.content.create(
|
23
|
+
container=self.portal,
|
24
|
+
type="imio.smartweb.Page",
|
25
|
+
title="My Page",
|
26
|
+
)
|
27
|
+
|
28
|
+
def test_getvocabulary(self):
|
29
|
+
self.request.form = {
|
30
|
+
"name": "imio.smartweb.vocabulary.Topics",
|
31
|
+
"field": "topics",
|
32
|
+
}
|
33
|
+
view = queryMultiAdapter((self.page, self.request), name="getVocabulary")
|
34
|
+
result = json.loads(view())
|
35
|
+
self.assertEqual(result["results"][0]["id"], "entertainment")
|
36
|
+
self.assertEqual(result["results"][0]["text"], "Entertainment")
|
37
|
+
with patch("plone.api.portal.get_current_language", return_value="fr"):
|
38
|
+
view = queryMultiAdapter((self.page, self.request), name="getVocabulary")
|
39
|
+
result = json.loads(view())
|
40
|
+
self.assertEqual(result["results"][0]["id"], "entertainment")
|
41
|
+
self.assertEqual(
|
42
|
+
result["results"][0]["text"], "Activités et divertissement"
|
43
|
+
)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: imio.smartweb.core
|
3
|
-
Version: 1.2.
|
3
|
+
Version: 1.2.52
|
4
4
|
Summary: Core product for iMio websites
|
5
5
|
Home-page: https://github.com/imio/imio.smartweb.core
|
6
6
|
Author: Christophe Boulanger
|
@@ -189,6 +189,14 @@ Changelog
|
|
189
189
|
=========
|
190
190
|
|
191
191
|
|
192
|
+
1.2.52 (2024-06-06)
|
193
|
+
-------------------
|
194
|
+
|
195
|
+
- WEB-4113 : Inherit `getVocabulary` from `imio.smartweb.common` view to handle
|
196
|
+
vocabularies translations correctly
|
197
|
+
[laulaz]
|
198
|
+
|
199
|
+
|
192
200
|
1.2.51 (2024-06-03)
|
193
201
|
-------------------
|
194
202
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
imio.smartweb.core-1.2.
|
1
|
+
imio.smartweb.core-1.2.52-py3.11-nspkg.pth,sha256=XZ3YhlzwpUCC8tXtelHRqxVxo3NWomIiMsUfUshrbeE,1011
|
2
2
|
imio/smartweb/core/__init__.py,sha256=iwhKnzeBJLKxpRVjvzwiRE63_zNpIBfaKLITauVph-0,24
|
3
3
|
imio/smartweb/core/config.py,sha256=BUgfvh4hCaw0onCYAG4gQI1O4hZ-GzXWEltdHi4YLIs,337
|
4
4
|
imio/smartweb/core/configure.zcml,sha256=PeC4rF--rF6MfVQ0NzggQrZWIl35oPtJdEhvQwGxhhI,1459
|
@@ -32,7 +32,7 @@ imio/smartweb/core/browser/layout.py,sha256=wvo_Q2dYg1Yd8wOdYSfPg29NPESy9ndAGl6z
|
|
32
32
|
imio/smartweb/core/browser/redirect_to_main_react_view.py,sha256=vzJwAet0P2uoMhlOtNjMy02e4LQw9DsHb6mRgBXGOB8,1668
|
33
33
|
imio/smartweb/core/browser/sitemap.py,sha256=voch7Bvchz3NTCm9zUC75sShCLD4KunLKyWA6OtaGmE,5962
|
34
34
|
imio/smartweb/core/browser/utils.py,sha256=ccA2DVA994S3t92_fQeMSFIGfAblE9C1vw78ZFUAJiU,3218
|
35
|
-
imio/smartweb/core/browser/vocabulary.py,sha256=
|
35
|
+
imio/smartweb/core/browser/vocabulary.py,sha256=VItGfYrv9NSHiUpEhnLkY4SpW8N2X91BX6A8UtsC8cA,1166
|
36
36
|
imio/smartweb/core/browser/banner/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
37
37
|
imio/smartweb/core/browser/banner/configure.zcml,sha256=Z2M7gkRDdmV4zRekUhyuJ-_jvbIbhgTj2Zq674iKvUE,389
|
38
38
|
imio/smartweb/core/browser/banner/settings.py,sha256=jfD705_q8MAHUJbjjcfcPj1f98Rahiz_Mks2Ctx5kMA,947
|
@@ -419,6 +419,7 @@ imio/smartweb/core/tests/test_text.py,sha256=DtZNNGJ-MDYbJ-YQj2C0q2Hr7t4-sUbV6SW
|
|
419
419
|
imio/smartweb/core/tests/test_toolbar.py,sha256=dxwOGNOg2wPkAnPU3hqGCI6VL2D2nPOIOtbMorvjfps,3823
|
420
420
|
imio/smartweb/core/tests/test_utils.py,sha256=CkRkK3SbT4oQx_-Nq2Z0AhmhzR4kk2BkIZqSbIiPU04,4125
|
421
421
|
imio/smartweb/core/tests/test_vocabularies.py,sha256=5DRfIlpOpXauXCgNN3UAUJJh246naykErGNBcYfYx0M,14368
|
422
|
+
imio/smartweb/core/tests/test_vocabulary.py,sha256=9S3BtVIJbN1o0q2qMcX8k0CdUwixmc3DBs_s5qFrJwA,1648
|
422
423
|
imio/smartweb/core/tests/utils.py,sha256=hsDrWOxL0oNNyx92Hke9Kj9ByKzc2kZ19q9QPVsNud4,2688
|
423
424
|
imio/smartweb/core/tests/resources/cirkwi_bad_widget_mock.html,sha256=13YeZ0mo8PoeHIHa64SLKuhNfGqBMT2uprmYDyQxE78,150
|
424
425
|
imio/smartweb/core/tests/resources/cirkwi_good_widget_mock.html,sha256=vBgQwBKNGcGRrOHfXYZO_gmAGL1oKPDIUOnDfXEHCR4,333252
|
@@ -722,10 +723,10 @@ imio/smartweb/core/webcomponents/src/utils/Map.jsx,sha256=cYuZykMIaLjr4KiLvmS4aY
|
|
722
723
|
imio/smartweb/core/webcomponents/src/utils/Map.scss,sha256=xXWz0O-JBwSZrzz2XeQdN4nZEOjppU2sVFtlLQOitQ8,77
|
723
724
|
imio/smartweb/core/webcomponents/src/utils/translation.js,sha256=5YDHwdaRNWFWOgyNd7YejoAdcDvnvAENo3Xn0GDT8P8,8941
|
724
725
|
imio/smartweb/core/webcomponents/src/utils/url.js,sha256=iyl_1QXfPBgUn0LEbZYT_zMEEjmj5DMiEz44Z6AKLcg,244
|
725
|
-
imio.smartweb.core-1.2.
|
726
|
-
imio.smartweb.core-1.2.
|
727
|
-
imio.smartweb.core-1.2.
|
728
|
-
imio.smartweb.core-1.2.
|
729
|
-
imio.smartweb.core-1.2.
|
730
|
-
imio.smartweb.core-1.2.
|
731
|
-
imio.smartweb.core-1.2.
|
726
|
+
imio.smartweb.core-1.2.52.dist-info/LICENSE.GPL,sha256=gXf5dRMhNSbfLPYYTY_5hsZ1r7UU1OaKQEAQUhuIBkM,18092
|
727
|
+
imio.smartweb.core-1.2.52.dist-info/LICENSE.rst,sha256=RzkMFz6AX3-cHd531zd2YQcXai8RIbjFWTs6m66Y5u4,653
|
728
|
+
imio.smartweb.core-1.2.52.dist-info/METADATA,sha256=bcDd59c8VA_xeaNZqd6VIxoDmSYHa2IQoIOt0wPEWV0,53781
|
729
|
+
imio.smartweb.core-1.2.52.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
730
|
+
imio.smartweb.core-1.2.52.dist-info/namespace_packages.txt,sha256=Pg8AH8t9viMMW1hJbNZvTy_n2jXG2igIYUpon5RA4Js,19
|
731
|
+
imio.smartweb.core-1.2.52.dist-info/top_level.txt,sha256=ZktC0EGzThvMTAin9_q_41rzvvfMT2FYbP8pbhSLMSA,5
|
732
|
+
imio.smartweb.core-1.2.52.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{imio.smartweb.core-1.2.51.dist-info → imio.smartweb.core-1.2.52.dist-info}/namespace_packages.txt
RENAMED
File without changes
|
File without changes
|