Skip to content

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

Closed

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.

Activity

  1. added theissue type on Oct 8, 2026
  2. rtibbles commented on Oct 16, 2026

    @rtibbles
    Member

    CI fixed by a1716cc; test_restore_channel.py passes on unstable at 98b560e.

    Restored and republished items are canonical-XML equal to the source. The remaining byte differences are lxml serialization only (single-quoted XML declaration, no space before />), and they come from publish, not restore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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