本文整理汇总了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)
示例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)
示例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()
示例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)