Skip to content

Commit

Permalink
chore: update openedx-learning, new object tags API format (unstable) (
Browse files Browse the repository at this point in the history
  • Loading branch information
bradenmacdonald authored Nov 6, 2023
1 parent 4f4e6dc commit 32bb4c5
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1136,13 +1136,19 @@ 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) == len(tag_values)
assert set(t["value"] for t in response.data) == set(tag_values)
tags_by_taxonomy = response.data[str(self.courseA)]["taxonomies"]
if tag_values:
response_taxonomy = tags_by_taxonomy[0]
assert response_taxonomy["name"] == taxonomy.name
response_tags = response_taxonomy["tags"]
assert [t["value"] for t in response_tags] == tag_values
else:
assert tags_by_taxonomy == [] # No tags are set from any taxonomy

# Check that re-fetching the tags returns what we set
response = self.client.get(url, format="json")
assert status.is_success(response.status_code)
assert set(t["value"] for t in response.data) == set(tag_values)
new_response = self.client.get(url, format="json")
assert status.is_success(new_response.status_code)
assert new_response.data == response.data

@ddt.data(
"staffA",
Expand Down Expand Up @@ -1214,13 +1220,19 @@ 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) == len(tag_values)
assert set(t["value"] for t in response.data) == set(tag_values)
tags_by_taxonomy = response.data[str(self.xblockA)]["taxonomies"]
if tag_values:
response_taxonomy = tags_by_taxonomy[0]
assert response_taxonomy["name"] == taxonomy.name
response_tags = response_taxonomy["tags"]
assert [t["value"] for t in response_tags] == tag_values
else:
assert tags_by_taxonomy == [] # No tags are set from any taxonomy

# Check that re-fetching the tags returns what we set
response = self.client.get(url, format="json")
assert status.is_success(response.status_code)
assert set(t["value"] for t in response.data) == set(tag_values)
new_response = self.client.get(url, format="json")
assert status.is_success(new_response.status_code)
assert new_response.data == response.data

@ddt.data(
"staffA",
Expand Down
2 changes: 1 addition & 1 deletion requirements/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ libsass==0.10.0
click==8.1.6

# pinning this version to avoid updates while the library is being developed
openedx-learning==0.3.0
openedx-learning==0.3.2

# lti-consumer-xblock 9.6.2 contains a breaking change that makes
# existing custom parameter configurations unusable.
Expand Down
2 changes: 1 addition & 1 deletion requirements/edx/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,7 @@ openedx-filters==1.6.0
# via
# -r requirements/edx/kernel.in
# lti-consumer-xblock
openedx-learning==0.3.0
openedx-learning==0.3.2
# via
# -c requirements/edx/../constraints.txt
# -r requirements/edx/kernel.in
Expand Down
2 changes: 1 addition & 1 deletion requirements/edx/development.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1315,7 +1315,7 @@ openedx-filters==1.6.0
# -r requirements/edx/doc.txt
# -r requirements/edx/testing.txt
# lti-consumer-xblock
openedx-learning==0.3.0
openedx-learning==0.3.2
# via
# -c requirements/edx/../constraints.txt
# -r requirements/edx/doc.txt
Expand Down
2 changes: 1 addition & 1 deletion requirements/edx/doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -925,7 +925,7 @@ openedx-filters==1.6.0
# via
# -r requirements/edx/base.txt
# lti-consumer-xblock
openedx-learning==0.3.0
openedx-learning==0.3.2
# via
# -c requirements/edx/../constraints.txt
# -r requirements/edx/base.txt
Expand Down
2 changes: 1 addition & 1 deletion requirements/edx/testing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -989,7 +989,7 @@ openedx-filters==1.6.0
# via
# -r requirements/edx/base.txt
# lti-consumer-xblock
openedx-learning==0.3.0
openedx-learning==0.3.2
# via
# -c requirements/edx/../constraints.txt
# -r requirements/edx/base.txt
Expand Down

0 comments on commit 32bb4c5

Please sign in to comment.