Skip to content

Restoring a published QTI item stores lxml's reserialization instead of the published XML #6305

Description

@rtibblesbot

❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.

Target branch: unstable

Observed behavior

Errors and logs

FAILED test_restore_channel.py::QTIRestoreTestCase::test_dual_published_node_restores_each_question_once
FAILED test_restore_channel.py::QTIRestoreTestCase::test_qti_only_node_restores_editor_and_legacy_items_as_qti
SUBFAILED(order=1) test_restore_channel.py::QTIRestoreTestCase::test_perseus_question_in_package_restores_as_perseus_question
E   AssertionError: '<?xml version=\'1.0\' encoding=\'UTF-8\'?>\n<qti-assess[1250 chars]tem>' != '<?xml version="1.0" encoding="UTF-8"?><qti-assessment-i[1247 chars]tem>'
contentcuration/contentcuration/tests/test_restore_channel.py:417: AssertionError

User-facing consequences

  • CI is red for every Studio PR, so real regressions in the Python suite are hidden.

Steps to reproduce

  1. Check out unstable at 51657a6d9.
  2. Run pytest contentcuration/contentcuration/tests/test_restore_channel.py -k QTIRestore.

Acceptance Criteria

  • pytest contentcuration/contentcuration/tests/test_restore_channel.py passes on unstable.
  • A restored QTI or Perseus-question item's raw_data equals its source item's raw_data.
  • Republishing a restored node produces package item files equal to the source package's.

AI usage

Claude Code found the failure while fixing CI on #6273, bisected it to the #6241/#6243 merge, and drafted this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions