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


Python GSoCProfileHelper.createStudentWithProject方法代码示例

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


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

示例1: testDashboardAsHost

# 需要导入模块: from tests.profile_utils import GSoCProfileHelper [as 别名]
# 或者: from tests.profile_utils.GSoCProfileHelper import createStudentWithProject [as 别名]
  def testDashboardAsHost(self):
    self.data.createHost()
    mentor = GSoCProfileHelper(self.gsoc, self.dev_test)
    mentor.createOtherUser('[email protected]').createMentor(self.org)
    student = GSoCProfileHelper(self.gsoc, self.dev_test)
    student.createOtherUser('[email protected]')
    student.createStudentWithProject(self.org, mentor.profile)

    url = '/gsoc/dashboard/' + self.gsoc.key().name()
    response = self.get(url)
    self.assertDashboardTemplatesUsed(response)
开发者ID:praveen97uma,项目名称:GSoC-Docs,代码行数:13,代码来源:test_dashboard.py

示例2: testOnlyAHostCanAccessTheAdminProfilePage

# 需要导入模块: from tests.profile_utils import GSoCProfileHelper [as 别名]
# 或者: from tests.profile_utils.GSoCProfileHelper import createStudentWithProject [as 别名]
  def testOnlyAHostCanAccessTheAdminProfilePage(self):
    """Tests that only the host is allowed to access profile pages.
    """
    mentor = GSoCProfileHelper(self.gsoc, self.dev_test)
    mentor.createOtherUser('[email protected]').createMentor(self.org)
    student = GSoCProfileHelper(self.gsoc, self.dev_test)
    student.createOtherUser('[email protected]')
    student.createStudentWithProject(self.org, mentor.profile)

    url = '/gsoc/profile/admin/' + student.profile.key().name()

    self.data.createStudent()
    response = self.get(url)
    self.assertResponseForbidden(response)

    self.data.deleteProfile().createMentor(self.org)
    response = self.get(url)
    self.assertResponseForbidden(response)
    
    self.data.createOrgAdmin(self.org)
    response = self.get(url)
    self.assertResponseForbidden(response)

    self.data.deleteProfile().createProfile()
    self.data.createHost()

    response = self.get(url)
    self.assertResponseOK(response)
    self.assertProfileShowPageTemplatesUsed(response)

    context = response.context
    self.assertTrue('page_name' in context)
    self.assertTrue('program_name' in context)
    self.assertTrue('profile' in context)
    self.assertTrue('user' in context)
    self.assertTrue('links' in context)
    self.assertTrue('css_prefix' in context)
    self.assertTrue('submit_tax_link' in context)
    self.assertTrue('submit_enrollment_link' in context)

    self.assertEqual(1, len(context['links']))
    
    expected_page_name = '%s Profile - %s' % (self.data.program.short_name, 
                                              student.profile.name())
    actual_page_name = context['page_name']
    self.assertEqual(expected_page_name, actual_page_name)
    
    expected_program_name = self.data.program.name
    actual_program_name = context['program_name']
    self.assertEqual(expected_program_name, actual_program_name)
开发者ID:adviti,项目名称:melange,代码行数:52,代码来源:test_profile_show.py

示例3: createStudent

# 需要导入模块: from tests.profile_utils import GSoCProfileHelper [as 别名]
# 或者: from tests.profile_utils.GSoCProfileHelper import createStudentWithProject [as 别名]
 def createStudent(self):
   """Creates a Student with a project.
   """
   profile_helper = GSoCProfileHelper(self.gsoc, self.dev_test)
   profile_helper.createOtherUser('[email protected]')
   self.student = profile_helper.createStudentWithProject(self.org,
                                                          self.mentor)
   self.project = GSoCProject.all().ancestor(self.student).get()
开发者ID:adviti,项目名称:melange,代码行数:10,代码来源:test_survey_reminders.py

示例4: getStudentEvalRecordProperties

# 需要导入模块: from tests.profile_utils import GSoCProfileHelper [as 别名]
# 或者: from tests.profile_utils.GSoCProfileHelper import createStudentWithProject [as 别名]
  def getStudentEvalRecordProperties(self, show=False):
    eval = self.evaluation.createStudentEvaluation()

    mentor_profile = GSoCProfileHelper(self.gsoc, self.dev_test)
    mentor_profile.createOtherUser('[email protected]')
    mentor = mentor_profile.createMentor(self.org)

    student_profile = GSoCProfileHelper(self.gsoc, self.dev_test)
    student_profile.createOtherUser('[email protected]')
    student_profile.createStudentWithProject(self.org, mentor)

    project = GSoCProject.all().get()

    suffix = "%s/%s/%s/%s" % (
        self.gsoc.key().name(), eval.link_id,
        project.parent().link_id, project.key().id())

    base_url = '/gsoc/eval/student'
    if show:
      url = '%s/show/%s' % (base_url, suffix)
    else:
      url = '%s/%s' % (base_url, suffix)

    return (url, eval, mentor)
开发者ID:adviti,项目名称:melange,代码行数:26,代码来源:test_student_evaluation.py


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