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 391cdd297459..9b87f35e0483 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 @@ -1818,7 +1818,7 @@ def test_export_course(self, user_attr) -> None: assert response.headers['Content-Type'] == 'text/csv' expected_csv = ( - '"Name","Type","ID","Taxonomy 1","Taxonomy 2"\r\n' + '"Name","Type","ID","1-taxonomy-1","2-taxonomy-2"\r\n' '"Test Course","course","course-v1:orgA+test_course+test_run","Tag 1.1",""\r\n' '" test sequential","sequential","block-v1:orgA+test_course+test_run+type@sequential+block@test_' 'sequential","Tag 1.1, Tag 1.2","Tag 2.1"\r\n' diff --git a/openedx/core/djangoapps/content_tagging/rest_api/v1/views.py b/openedx/core/djangoapps/content_tagging/rest_api/v1/views.py index 8c23c56970e5..92c51911db37 100644 --- a/openedx/core/djangoapps/content_tagging/rest_api/v1/views.py +++ b/openedx/core/djangoapps/content_tagging/rest_api/v1/views.py @@ -173,8 +173,7 @@ def _generate_csv_rows() -> Iterator[str]: # Prepare the header for the taxonomies for taxonomy_id, taxonomy in taxonomies.items(): - # ToDo: change to taxonomy.external_id after the external_id is implemented - header[f"taxonomy_{taxonomy_id}"] = taxonomy.name + header[f"taxonomy_{taxonomy_id}"] = taxonomy.export_id csv_writer = csv.DictWriter(pseudo_buffer, fieldnames=header.keys(), quoting=csv.QUOTE_NONNUMERIC) yield csv_writer.writerow(header)