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


Python GSoCProfileHelper.createOrgAdmin方法代码示例

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


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

示例1: createOrgAdmin

# 需要导入模块: from tests.profile_utils import GSoCProfileHelper [as 别名]
# 或者: from tests.profile_utils.GSoCProfileHelper import createOrgAdmin [as 别名]
 def createOrgAdmin(self, email, organization):
   """Creates an organization admin for the given organization.
   """
   profile_helper = GSoCProfileHelper(self.program, dev_test=False)
   profile_helper.createOtherUser(email)
   admin = profile_helper.createOrgAdmin(organization)
   return admin
开发者ID:adviti,项目名称:melange,代码行数:9,代码来源:test_profile.py

示例2: testRequestMentor

# 需要导入模块: from tests.profile_utils import GSoCProfileHelper [as 别名]
# 或者: from tests.profile_utils.GSoCProfileHelper import createOrgAdmin [as 别名]
  def testRequestMentor(self):
    admin = GSoCProfileHelper(self.gsoc, self.dev_test)
    admin.createOtherUser('[email protected]')
    admin.createOrgAdmin(self.org)
    admin.notificationSettings(new_requests=True)

    other_admin = GSoCProfileHelper(self.gsoc, self.dev_test)
    other_admin.createOtherUser('[email protected]')
    other_admin.createOrgAdmin(self.org)
    other_admin.notificationSettings()

    # test GET
    self.data.createProfile()
    url = '/gsoc/request/' + self.org.key().name()
    response = self.get(url)
    self.assertRequestTemplatesUsed(response)

    # test POST
    override = {'status': 'pending', 'role': 'mentor', 'type': 'Request',
                'user': self.data.user, 'org': self.org}
    response, properties = self.modelPost(url, GSoCRequest, override)

    request = GSoCRequest.all().get()
    self.assertPropertiesEqual(properties, request)

    self.assertEmailSent(to=admin.profile.email, n=1)
    self.assertEmailNotSent(to=other_admin.profile.email)

    # test withdrawing a request
    url = '/gsoc/request/%s/%s/%s' % (
        self.gsoc.key().name(),
        request.parent_key().name(),
        request.key().id())

    postdata = {'action': 'Withdraw'}
    response = self.post(url, postdata)
    self.assertResponseRedirect(response)
    request = GSoCRequest.all().get()
    self.assertEqual('withdrawn', request.status)

    # test that you can resubmit
    postdata = {'action': 'Resubmit'}
    response = self.post(url, postdata)
    self.assertResponseRedirect(response)
    request = GSoCRequest.all().get()
    self.assertEqual('pending', request.status)
开发者ID:praveen97uma,项目名称:GSoC-Docs,代码行数:48,代码来源:test_request.py

示例3: testRequestMentor

# 需要导入模块: from tests.profile_utils import GSoCProfileHelper [as 别名]
# 或者: from tests.profile_utils.GSoCProfileHelper import createOrgAdmin [as 别名]
    def testRequestMentor(self):
        admin = GSoCProfileHelper(self.gsoc, self.dev_test)
        admin.createOtherUser("[email protected]")
        admin.createOrgAdmin(self.org)
        admin.notificationSettings(new_requests=True)

        other_admin = GSoCProfileHelper(self.gsoc, self.dev_test)
        other_admin.createOtherUser("[email protected]")
        other_admin.createOrgAdmin(self.org)
        other_admin.notificationSettings()

        # test GET
        self.data.createProfile()
        url = "/gsoc/request/" + self.org.key().name()
        response = self.get(url)
        self.assertRequestTemplatesUsed(response)

        # test POST
        override = {"status": "pending", "role": "mentor", "type": "Request", "user": self.data.user, "org": self.org}
        response, properties = self.modelPost(url, GSoCRequest, override)

        request = GSoCRequest.all().get()
        self.assertPropertiesEqual(properties, request)

        self.assertEmailSent(to=admin.profile.email, n=1)
        self.assertEmailNotSent(to=other_admin.profile.email)

        # test withdrawing a request
        url = "/gsoc/request/%s/%s" % (self.gsoc.key().name(), request.key().id())

        postdata = {"action": "Withdraw"}
        response = self.post(url, postdata)
        self.assertResponseRedirect(response)
        request = GSoCRequest.all().get()
        self.assertEqual("withdrawn", request.status)

        # test that you can resubmit
        postdata = {"action": "Resubmit"}
        response = self.post(url, postdata)
        self.assertResponseRedirect(response)
        request = GSoCRequest.all().get()
        self.assertEqual("pending", request.status)
开发者ID:adviti,项目名称:melange,代码行数:44,代码来源:test_request.py


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