feat: deserialize tag info from xml [FC-0049]#2181
Conversation
|
Thanks for the pull request, @rpenido! Please note that it may take us up to several weeks or months to complete a review and merge your PR. Feel free to add as much of the following information to the ticket as you can:
All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here. Please let us know once your PR is ready for our review and all tests are green. |
| # Deserialize and add tag data info to block if any | ||
| if hasattr(block, 'read_tags_from_node') and callable(block.read_tags_from_node): # pylint: disable=no-member | ||
| # This comes from TaggedBlockMixin | ||
| block.read_tags_from_node(node) # pylint: disable=no-member |
There was a problem hiding this comment.
This is working as expected manual testing in the edx-platform, but in the tests here, it fails. I think it is because this block doesn't have the XmlMixin. As it is a new dependency, I'm unsure if I should add it here or find another way to test it.
There was a problem hiding this comment.
Yes, I faced similar issues when implementing the copy functionality. Since we don't have access to the XBLOCK_MIXINS in edx-platform in this repo (because edx-ora2 is imported into edx-platform), you need to manually add the methods/fields for the tests to work.
Here is an example of how I did it in my tests:
edx-ora2/openassessment/xblock/test/test_xml.py
Lines 219 to 251 in c76a89c
There was a problem hiding this comment.
Thank you @yusuf-musleh! It took me some time but I figure it out with your help!
Could you take another look at it please?
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2181 +/- ##
==========================================
+ Coverage 94.99% 95.01% +0.01%
==========================================
Files 191 191
Lines 20999 21014 +15
Branches 1898 1899 +1
==========================================
+ Hits 19949 19966 +17
+ Misses 786 785 -1
+ Partials 264 263 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
17f12dd to
e8b7395
Compare
e17bca6 to
48f7a8f
Compare
pomegranited
left a comment
There was a problem hiding this comment.
👍
- I tested this by copy/pasting tagged ORA2 blocks using this code and openedx/openedx-platform#34270 , and it works as expected.
- I read through the code
-
I checked for accessibility issuesN/A - Includes documentation
-
User-facing strings are extracted for translationN/A
|
@rpenido 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future. |
|
FYI @rpenido We can revert this change if open-craft/openedx-platform#640 tests out ok. |
This reverts commit 5329fea.
Description
This PR adds support to deserialize tag info from the block XML, adding it to the new
xml_attributesproperty. This is used to allow pasting OpenAsssessments components with their applied tags.More Information
Testing instructions