From b8b1fa7ce5cd9361b2490f8233c9ab051a26e5df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B4mulo=20Penido?= Date: Fri, 22 Sep 2023 08:35:58 -0300 Subject: [PATCH 1/3] feat: remove object tagging rest api pagination --- .../content_tagging/rest_api/v1/tests/test_views.py | 9 +++++---- requirements/constraints.txt | 2 +- requirements/edx/base.txt | 2 +- requirements/edx/development.txt | 2 +- requirements/edx/doc.txt | 2 +- requirements/edx/kernel.in | 3 ++- requirements/edx/testing.txt | 2 +- 7 files changed, 12 insertions(+), 10 deletions(-) diff --git a/openedx/core/djangoapps/content_tagging/rest_api/v1/tests/test_views.py b/openedx/core/djangoapps/content_tagging/rest_api/v1/tests/test_views.py index f816436e2c25..d5f31c039a9b 100644 --- a/openedx/core/djangoapps/content_tagging/rest_api/v1/tests/test_views.py +++ b/openedx/core/djangoapps/content_tagging/rest_api/v1/tests/test_views.py @@ -735,8 +735,9 @@ def test_tag_course(self, user_attr, taxonomy_attr, tag_values, expected_status) assert response.status_code == expected_status if status.is_success(expected_status): - assert len(response.data.get("results")) == len(tag_values) - assert set(t["value"] for t in response.data["results"]) == set(tag_values) + assert len(response.data) == len(tag_values) + assert set(t["value"] for t in response.data) == set(tag_values) + @ddt.data( # Can't add invalid tags to a object using a closed taxonomy @@ -803,8 +804,8 @@ def test_tag_xblock(self, user_attr, taxonomy_attr, tag_values, expected_status) assert response.status_code == expected_status if status.is_success(expected_status): - assert len(response.data.get("results")) == len(tag_values) - assert set(t["value"] for t in response.data["results"]) == set(tag_values) + assert len(response.data) == len(tag_values) + assert set(t["value"] for t in response.data) == set(tag_values) @ddt.data( # Can't add invalid tags to a object using a closed taxonomy diff --git a/requirements/constraints.txt b/requirements/constraints.txt index 87fadf16e267..65619d668a21 100644 --- a/requirements/constraints.txt +++ b/requirements/constraints.txt @@ -128,7 +128,7 @@ click==8.1.6 openedx-events<8.6.0 # Open edX Events from Hooks Extension Framework (OEP-50) # pinning this version to avoid updates while the library is being developed -openedx-learning==0.1.6 +openedx-learning==0.1.7 # lti-consumer-xblock 9.6.2 contains a breaking change that makes # existing custom parameter configurations unusable. diff --git a/requirements/edx/base.txt b/requirements/edx/base.txt index 63a5befdd5e4..9778e5558e7f 100644 --- a/requirements/edx/base.txt +++ b/requirements/edx/base.txt @@ -790,7 +790,7 @@ openedx-filters==1.6.0 # via # -r requirements/edx/kernel.in # lti-consumer-xblock -openedx-learning==0.1.6 +openedx-learning @ git+https://github.com/open-craft/openedx-learning@rpenido/fal-3501-enforce-limit-on-number-of-tags-per-object # via # -c requirements/edx/../constraints.txt # -r requirements/edx/kernel.in diff --git a/requirements/edx/development.txt b/requirements/edx/development.txt index 7c5173ccaaed..b391a82f98d7 100644 --- a/requirements/edx/development.txt +++ b/requirements/edx/development.txt @@ -1321,7 +1321,7 @@ openedx-filters==1.6.0 # -r requirements/edx/doc.txt # -r requirements/edx/testing.txt # lti-consumer-xblock -openedx-learning==0.1.6 +openedx-learning @ git+https://github.com/open-craft/openedx-learning@rpenido/fal-3501-enforce-limit-on-number-of-tags-per-object # via # -c requirements/edx/../constraints.txt # -r requirements/edx/doc.txt diff --git a/requirements/edx/doc.txt b/requirements/edx/doc.txt index d9cbb521ef74..67b22a3c36b0 100644 --- a/requirements/edx/doc.txt +++ b/requirements/edx/doc.txt @@ -928,7 +928,7 @@ openedx-filters==1.6.0 # via # -r requirements/edx/base.txt # lti-consumer-xblock -openedx-learning==0.1.6 +openedx-learning @ git+https://github.com/open-craft/openedx-learning@rpenido/fal-3501-enforce-limit-on-number-of-tags-per-object # via # -c requirements/edx/../constraints.txt # -r requirements/edx/base.txt diff --git a/requirements/edx/kernel.in b/requirements/edx/kernel.in index dd3403655d28..3c6fd7e19ec6 100644 --- a/requirements/edx/kernel.in +++ b/requirements/edx/kernel.in @@ -116,7 +116,8 @@ openedx-calc # Library supporting mathematical calculatio openedx-django-require openedx-events # Open edX Events from Hooks Extension Framework (OEP-50) openedx-filters # Open edX Filters from Hooks Extension Framework (OEP-50) -openedx-learning # Open edX Learning core (experimental) +# openedx-learning # Open edX Learning core (experimental) +openedx-learning @ git+https://github.com/open-craft/openedx-learning@rpenido/fal-3501-enforce-limit-on-number-of-tags-per-object # Remove this once openedx-learning is tagged openedx-mongodbproxy openedx-django-wiki openedx-blockstore diff --git a/requirements/edx/testing.txt b/requirements/edx/testing.txt index 2a07c19de058..7775de7047ca 100644 --- a/requirements/edx/testing.txt +++ b/requirements/edx/testing.txt @@ -998,7 +998,7 @@ openedx-filters==1.6.0 # via # -r requirements/edx/base.txt # lti-consumer-xblock -openedx-learning==0.1.6 +openedx-learning @ git+https://github.com/open-craft/openedx-learning@rpenido/fal-3501-enforce-limit-on-number-of-tags-per-object # via # -c requirements/edx/../constraints.txt # -r requirements/edx/base.txt From ec19df3ad975520d14bbf030715571cbf1cc7cae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B4mulo=20Penido?= Date: Fri, 22 Sep 2023 09:10:50 -0300 Subject: [PATCH 2/3] style: fix pylint --- .../djangoapps/content_tagging/rest_api/v1/tests/test_views.py | 1 - 1 file changed, 1 deletion(-) diff --git a/openedx/core/djangoapps/content_tagging/rest_api/v1/tests/test_views.py b/openedx/core/djangoapps/content_tagging/rest_api/v1/tests/test_views.py index d5f31c039a9b..2eafb933b483 100644 --- a/openedx/core/djangoapps/content_tagging/rest_api/v1/tests/test_views.py +++ b/openedx/core/djangoapps/content_tagging/rest_api/v1/tests/test_views.py @@ -738,7 +738,6 @@ def test_tag_course(self, user_attr, taxonomy_attr, tag_values, expected_status) assert len(response.data) == len(tag_values) assert set(t["value"] for t in response.data) == set(tag_values) - @ddt.data( # Can't add invalid tags to a object using a closed taxonomy (None, "tA1", ["invalid"], status.HTTP_403_FORBIDDEN), From 3d9126e5d3cee80208a6adc457736def1e61ff30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B4mulo=20Penido?= Date: Tue, 26 Sep 2023 09:23:08 -0300 Subject: [PATCH 3/3] chore: update requirements --- requirements/edx/base.txt | 2 +- requirements/edx/development.txt | 2 +- requirements/edx/doc.txt | 2 +- requirements/edx/kernel.in | 3 +-- requirements/edx/testing.txt | 2 +- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/requirements/edx/base.txt b/requirements/edx/base.txt index 88cd30ac70be..996af00f79e2 100644 --- a/requirements/edx/base.txt +++ b/requirements/edx/base.txt @@ -784,7 +784,7 @@ openedx-filters==1.6.0 # via # -r requirements/edx/kernel.in # lti-consumer-xblock -openedx-learning @ git+https://github.com/open-craft/openedx-learning@rpenido/fal-3501-enforce-limit-on-number-of-tags-per-object +openedx-learning==0.1.7 # via # -c requirements/edx/../constraints.txt # -r requirements/edx/kernel.in diff --git a/requirements/edx/development.txt b/requirements/edx/development.txt index 303241ac3ba1..b1a99ee50eaf 100644 --- a/requirements/edx/development.txt +++ b/requirements/edx/development.txt @@ -1317,7 +1317,7 @@ openedx-filters==1.6.0 # -r requirements/edx/doc.txt # -r requirements/edx/testing.txt # lti-consumer-xblock -openedx-learning @ git+https://github.com/open-craft/openedx-learning@rpenido/fal-3501-enforce-limit-on-number-of-tags-per-object +openedx-learning==0.1.7 # via # -c requirements/edx/../constraints.txt # -r requirements/edx/doc.txt diff --git a/requirements/edx/doc.txt b/requirements/edx/doc.txt index c6db760b2ae8..ad2657d3b8ed 100644 --- a/requirements/edx/doc.txt +++ b/requirements/edx/doc.txt @@ -924,7 +924,7 @@ openedx-filters==1.6.0 # via # -r requirements/edx/base.txt # lti-consumer-xblock -openedx-learning @ git+https://github.com/open-craft/openedx-learning@rpenido/fal-3501-enforce-limit-on-number-of-tags-per-object +openedx-learning==0.1.7 # via # -c requirements/edx/../constraints.txt # -r requirements/edx/base.txt diff --git a/requirements/edx/kernel.in b/requirements/edx/kernel.in index 3c6fd7e19ec6..dd3403655d28 100644 --- a/requirements/edx/kernel.in +++ b/requirements/edx/kernel.in @@ -116,8 +116,7 @@ openedx-calc # Library supporting mathematical calculatio openedx-django-require openedx-events # Open edX Events from Hooks Extension Framework (OEP-50) openedx-filters # Open edX Filters from Hooks Extension Framework (OEP-50) -# openedx-learning # Open edX Learning core (experimental) -openedx-learning @ git+https://github.com/open-craft/openedx-learning@rpenido/fal-3501-enforce-limit-on-number-of-tags-per-object # Remove this once openedx-learning is tagged +openedx-learning # Open edX Learning core (experimental) openedx-mongodbproxy openedx-django-wiki openedx-blockstore diff --git a/requirements/edx/testing.txt b/requirements/edx/testing.txt index 1b6f21dec155..4f986b12fc9f 100644 --- a/requirements/edx/testing.txt +++ b/requirements/edx/testing.txt @@ -991,7 +991,7 @@ openedx-filters==1.6.0 # via # -r requirements/edx/base.txt # lti-consumer-xblock -openedx-learning @ git+https://github.com/open-craft/openedx-learning@rpenido/fal-3501-enforce-limit-on-number-of-tags-per-object +openedx-learning==0.1.7 # via # -c requirements/edx/../constraints.txt # -r requirements/edx/base.txt