-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Edx platform 35175 deprecate assert dict contains subset #36236
base: master
Are you sure you want to change the base?
Edx platform 35175 deprecate assert dict contains subset #36236
Conversation
The original request was that enterprise users with tpa hint and SAML should not be redirected to MFE. The current condition also excludes regular non-enterprise users with SAML authentication from the MFE.
The original request was that enterprise users with tpa hint and SAML should not be redirected to MFE. The current condition also excludes regular non-enterprise users with SAML authentication from the MFE.
The assertDictContainsSubset method was deprecated in version 3.2 and removed in version 3.11. Updated test_create_with_invalid_course_team to use assertEqual with dict.get() instead.
Thanks for the pull request, @leoaulasneo98! This repository is currently maintained by 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 approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo 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:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. 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:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
Hi @leoaulasneo98! Can you try re-running the checks? Hopefully the CLA check should turn green. |
Description
Replace the deprecated assertDictContainsSubset method in test_course_runs.py with assertEqual. This change is necessary as assertDictContainsSubset was deprecated in Python 3.2 and removed in Python 3.11.
This change impacts the "Developer" role only, as it's a modification to the test suite.
Before:
self.assertDictContainsSubset({'team': ['Course team user does not exist']}, response.data)
After:
self.assertEqual(response.data.get('team'), ['Course team user does not exist'])
Supporting information
Related Python issue: python/cpython#28268
The change aligns with Python's deprecation of assertDictContainsSubset
Testing instructions
Navigate to the edx-platform directory
Run the specific test:
pytest cms/djangoapps/api/v1/tests/test_views/test_course_runs.py::CourseRunViewSetTests::test_create_with_invalid_course_team -v
Verify the test passes
Deadline
None - This is a maintenance update to support Python 3.11 compatibility.
Other information
This change is part of the ongoing effort to maintain Python 3.11 compatibility

No database migrations are required
No special concerns or limitations
No dependencies on other changes