Skip to content

Conversation

haftamuk
Copy link
Contributor

@haftamuk haftamuk commented Oct 7, 2025

In order to be able to share course certificate to LinkedIn, configure SOCIAL_SHARING_SETTINGS with a value True for CERTIFICATE_LINKEDIN entry. The setting is not available by default, but when used there were failing tests and this change ensures all tests pass.

Fixes: #37428 (comment)

Testing instructions

  • Change configuration value of CERTIFICATE_LINKEDIN to True at /lms/envs/common.py and cms/envs/common.py
    run
    python -Wd -m pytest -p no:randomly --ds=lms.envs.test common/djangoapps/student/tests/
    See all tests should pass

  • Change configuration value of CERTIFICATE_LINKEDIN to False at /lms/envs/common.py and cms/envs/common.py
    run
    python -Wd -m pytest -p no:randomly --ds=lms.envs.test common/djangoapps/student/tests/
    See all tests should pass

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Oct 7, 2025
@openedx-webhooks
Copy link

openedx-webhooks commented Oct 7, 2025

Thanks for the pull request, @haftamuk!

This repository is currently maintained by @openedx/wg-maintenance-edx-platform.

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.


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.

@github-project-automation github-project-automation bot moved this to Needs Triage in Contributions Oct 7, 2025
@haftamuk haftamuk changed the title fix: Resolves faling tests when CERTIFICATE_LINKEDIN setting is confi… fix: Resolves failing tests when CERTIFICATE_LINKEDIN setting is configured Oct 7, 2025
@haftamuk haftamuk marked this pull request as ready for review October 7, 2025 09:09
@haftamuk haftamuk force-pushed the ESHE-37428 branch 3 times, most recently from 5719fef to 9d75af6 Compare October 7, 2025 09:14
…gured at common.py openedx#37428

In order to be able to share course certificate to LinkedIn, configure
SOCIAL_SHARING_SETTINGS with a value True for CERTIFICATE_LINKEDIN
entry. The setting is not available by default, but when used there
were failing tests and this change ensures all tests pass.

Fixes: openedx#37428 (comment)
@mphilbrick211 mphilbrick211 added the needs test run Author's first PR to this repository, awaiting test authorization from Axim label Oct 8, 2025
@mphilbrick211 mphilbrick211 moved this from Needs Triage to Needs Tests Run or CLA Signed in Contributions Oct 8, 2025
Copy link
Member

@deborahgu deborahgu left a comment

Choose a reason for hiding this comment

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

one nit here, also, could you resolve the conflicts?

'do not have a current verified identity with {platform_name}'
.format(platform_name=settings.PLATFORM_NAME))

def test_post_to_linkedin_visibility(self):
Copy link
Member

Choose a reason for hiding this comment

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

[nit] look at how other tests in this file use ddt.data. For a simple case like this, that can be a cleaner way to test the condition. For example, you can use

    @ddt.data(
        (True, True),
        (False, False),
    )
    @ddt.unpack
    def test_post_to_linkedin_visibility(self, certificate_linkedin_enabled, linkedin_button_visible):

and then you don't need to test both configurations separately; the test runner will verify both configurations for you.

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

Labels

needs test run Author's first PR to this repository, awaiting test authorization from Axim open-source-contribution PR author is not from Axim or 2U

Projects

Status: Needs Tests Run or CLA Signed

Development

Successfully merging this pull request may close these issues.

There are failing tests when CERTIFICATE_LINKEDIN setting is configured at common.py

4 participants