Skip to content

fix: Remove TypeError in favor of pass through for unit tests#576

Closed
mgwozdz-unicon wants to merge 1 commit intoopenedx:mainfrom
mgwozdz-unicon:fix-tag-deletion-type-error
Closed

fix: Remove TypeError in favor of pass through for unit tests#576
mgwozdz-unicon wants to merge 1 commit intoopenedx:mainfrom
mgwozdz-unicon:fix-tag-deletion-type-error

Conversation

@mgwozdz-unicon
Copy link
Copy Markdown
Contributor

To address

FAILED cms/djangoapps/contentstore/views/tests/test_clipboard_paste.py::ClipboardPasteTestCase::test_copy_and_paste_unit_with_tags - TypeError: Expected origin to be Tag, QuerySet[Tag], or None; got Taxonomy

Co-authored-by: Copilot <copilot@github.com>
@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Apr 30, 2026
@openedx-webhooks
Copy link
Copy Markdown

Thanks for the pull request, @mgwozdz-unicon!

This repository is currently maintained by @axim-engineering.

Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review.

🔘 Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.

Details
Where can I find more information?

If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:

When can I expect my changes to be merged?

Our goal is to get community contributions seen and reviewed as efficiently as possible.

However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

Copy link
Copy Markdown
Member

@kdmccormick kdmccormick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to actually handle this case rather than just patch it in tests, since it's possible to delete a Taxonomy from the platform.

Could you review #575 and/or #577 ?

ormsbee
ormsbee previously approved these changes Apr 30, 2026
@ormsbee ormsbee dismissed their stale review April 30, 2026 12:42

Looking at alternate suggestion.

Copy link
Copy Markdown
Member

@kdmccormick kdmccormick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see, I think this is actually the right fix if we don't want to emit any events when a Taxonomy is deleted. #575 is only the right fix if we do want events from the top-level tags when a Taxonomy is deleted.

This PR fine by me, but I'll defer to @ormsbee to approve if this is the right behavior. My only request is that we update the comment to clarify that a Taxonomy CASCADE can happen in real code, not just unit tests.

Thanks!

Comment on lines +37 to +38
# This is needed to prevent unit test failures where this is called when origin
# is not a Tag or QuerySet.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# This is needed to prevent unit test failures where this is called when origin
# is not a Tag or QuerySet.
# In the event of a CASCADE deletion (e.g. from Taxonomy), emit no events.

@kdmccormick
Copy link
Copy Markdown
Member

Closed in favor of #575

@github-project-automation github-project-automation Bot moved this from Needs Triage to Done in Contributions Apr 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

open-source-contribution PR author is not from Axim or 2U

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants