当前位置: 首页>>代码示例>>Python>>正文


Python LinkedInAddToProfileConfiguration.add_to_profile_url方法代码示例

本文整理汇总了Python中student.models.LinkedInAddToProfileConfiguration.add_to_profile_url方法的典型用法代码示例。如果您正苦于以下问题:Python LinkedInAddToProfileConfiguration.add_to_profile_url方法的具体用法?Python LinkedInAddToProfileConfiguration.add_to_profile_url怎么用?Python LinkedInAddToProfileConfiguration.add_to_profile_url使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在student.models.LinkedInAddToProfileConfiguration的用法示例。


在下文中一共展示了LinkedInAddToProfileConfiguration.add_to_profile_url方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_linked_in_url_with_cert_name_override

# 需要导入模块: from student.models import LinkedInAddToProfileConfiguration [as 别名]
# 或者: from student.models.LinkedInAddToProfileConfiguration import add_to_profile_url [as 别名]
    def test_linked_in_url_with_cert_name_override(self, cert_mode, expected_cert_name):
        config = LinkedInAddToProfileConfiguration(
            company_identifier='0_mC_o2MizqdtZEmkVXjH4eYwMj4DnkCWrZP_D9',
            enabled=True
        )

        expected_url = (
            'http://www.linkedin.com/profile/add'
            '?_ed=0_mC_o2MizqdtZEmkVXjH4eYwMj4DnkCWrZP_D9&'
            'pfCertificationName={platform_name}+{expected_cert_name}&'
            'pfCertificationUrl=http%3A%2F%2Fs3.edx%2Fcert&'
            'source=o'
        ).format(
            expected_cert_name=expected_cert_name,
            platform_name=quote(settings.PLATFORM_NAME.encode('utf-8'))
        )

        with with_site_configuration_context(configuration=self.SITE_CONFIGURATION):
            actual_url = config.add_to_profile_url(
                self.COURSE_KEY,
                self.COURSE_NAME,
                cert_mode,
                self.CERT_URL
            )

            self.assertEqual(actual_url, expected_url)
开发者ID:Colin-Fredericks,项目名称:edx-platform,代码行数:28,代码来源:test_linkedin.py

示例2: test_linked_in_url_tracking_code

# 需要导入模块: from student.models import LinkedInAddToProfileConfiguration [as 别名]
# 或者: from student.models.LinkedInAddToProfileConfiguration import add_to_profile_url [as 别名]
    def test_linked_in_url_tracking_code(self):
        config = LinkedInAddToProfileConfiguration(company_identifier="abcd123", trk_partner_name="edx", enabled=True)

        expected_param = urlencode({"trk": u"edx-{course_key}_honor-dashboard".format(course_key=self.COURSE_KEY)})

        actual_url = config.add_to_profile_url(self.COURSE_KEY, self.COURSE_NAME, "honor", self.CERT_URL)

        self.assertIn(expected_param, actual_url)
开发者ID:hastexo,项目名称:edx-platform,代码行数:10,代码来源:test_linkedin.py

示例3: test_linked_in_url

# 需要导入模块: from student.models import LinkedInAddToProfileConfiguration [as 别名]
# 或者: from student.models.LinkedInAddToProfileConfiguration import add_to_profile_url [as 别名]
    def test_linked_in_url(self, cert_mode, expected_cert_name):
        config = LinkedInAddToProfileConfiguration(
            company_identifier="0_mC_o2MizqdtZEmkVXjH4eYwMj4DnkCWrZP_D9", enabled=True
        )

        expected_url = (
            "http://www.linkedin.com/profile/add"
            "?_ed=0_mC_o2MizqdtZEmkVXjH4eYwMj4DnkCWrZP_D9&"
            "pfCertificationName={platform_name}+{expected_cert_name}&"
            "pfCertificationUrl=http%3A%2F%2Fs3.edx%2Fcert&"
            "source=o"
        ).format(expected_cert_name=expected_cert_name, platform_name=quote(settings.PLATFORM_NAME.encode("utf-8")))

        actual_url = config.add_to_profile_url(self.COURSE_KEY, self.COURSE_NAME, cert_mode, self.CERT_URL)

        self.assertEqual(actual_url, expected_url)
开发者ID:hastexo,项目名称:edx-platform,代码行数:18,代码来源:test_linkedin.py

示例4: test_linked_in_url

# 需要导入模块: from student.models import LinkedInAddToProfileConfiguration [as 别名]
# 或者: from student.models.LinkedInAddToProfileConfiguration import add_to_profile_url [as 别名]
    def test_linked_in_url(self, cert_mode, expected_cert_name):
        config = LinkedInAddToProfileConfiguration(
            company_identifier='0_mC_o2MizqdtZEmkVXjH4eYwMj4DnkCWrZP_D9',
            enabled=True
        )

        expected_url = (
            'http://www.linkedin.com/profile/add'
            '?_ed=0_mC_o2MizqdtZEmkVXjH4eYwMj4DnkCWrZP_D9&'
            'pfCertificationName={expected_cert_name}&'
            'pfCertificationUrl=http%3A%2F%2Fs3.edx%2Fcert&'
            'source=o'
        ).format(expected_cert_name=expected_cert_name)

        actual_url = config.add_to_profile_url(
            self.COURSE_KEY,
            self.COURSE_NAME,
            cert_mode,
            self.CERT_URL
        )

        self.assertEqual(actual_url, expected_url)
开发者ID:10clouds,项目名称:edx-platform,代码行数:24,代码来源:test_linkedin.py


注:本文中的student.models.LinkedInAddToProfileConfiguration.add_to_profile_url方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。