Skip to content
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

[Django 4.2]: Fix: resolver.func.__name__ issue #33133

Merged
merged 1 commit into from
Aug 30, 2023

Conversation

irtazaakram
Copy link
Member

@irtazaakram irtazaakram commented Aug 30, 2023

Description

Fixes the issue when upgrading to Django 4.2

/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/django/db/models/base.py:500: TypeError
____________________ CcxDetailTest.test_resolve_get_detail _____________________

self = <lms.djangoapps.ccx.api.v0.tests.test_views.CcxDetailTest testMethod=test_resolve_get_detail>

    def test_resolve_get_detail(self):
        """
        Test for the ccx detail view resolver. This is needed because it is assumed
        that only an URL with a valid course id string can reach the detail view.
        """
        # get the base url from the valid one to build invalid urls
        base_url = '{}/'.format(self.detail_url.rsplit('/', 1)[0])
        # this url should be the same of the ccx list view
        resolver = resolve(base_url)
>       assert views.CCXListView.__name__ == resolver.func.__name__
E       AssertionError: assert 'CCXListView' == 'view'
E         - view
E         + CCXListView

Reference
django/django#14138
django/django#14124

@awais786 awais786 merged commit 09f84e5 into master Aug 30, 2023
42 checks passed
@awais786 awais786 deleted the fix-func.__name__-issue-with-view branch August 30, 2023 09:18
@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production.

Yagnesh1998 pushed a commit to ManpraXSoftware/edx-platform that referenced this pull request Sep 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants