本文整理汇总了Python中tests.profile_utils.GSoCProfileHelper.createStudent方法的典型用法代码示例。如果您正苦于以下问题:Python GSoCProfileHelper.createStudent方法的具体用法?Python GSoCProfileHelper.createStudent怎么用?Python GSoCProfileHelper.createStudent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tests.profile_utils.GSoCProfileHelper
的用法示例。
在下文中一共展示了GSoCProfileHelper.createStudent方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testAcceptProposalButton
# 需要导入模块: from tests.profile_utils import GSoCProfileHelper [as 别名]
# 或者: from tests.profile_utils.GSoCProfileHelper import createStudent [as 别名]
def testAcceptProposalButton(self):
student = GSoCProfileHelper(self.gsoc, self.dev_test)
student.createOtherUser('[email protected]')
student.createStudent()
proposal = self.createProposal({'scope': student.profile,
'parent': student.profile})
suffix = "%s/%s/%d" % (
self.gsoc.key().name(),
student.user.key().name(),
proposal.key().id())
self.data.createMentor(self.org)
url = '/gsoc/proposal/accept/' + suffix
postdata = {'value': 'unchecked'}
response = self.post(url, postdata)
# fail if mentor tries to accept the proposal
self.assertResponseForbidden(response)
proposal = GSoCProposal.all().get()
self.assertFalse(proposal.accept_as_project)
# accept the proposal as project when the org admin tries to accept
# the proposal
self.data.createOrgAdmin(self.org)
response = self.post(url, postdata)
self.assertResponseOK(response)
proposal = GSoCProposal.all().get()
self.assertTrue(proposal.accept_as_project)
示例2: testFeaturedProjectButton
# 需要导入模块: from tests.profile_utils import GSoCProfileHelper [as 别名]
# 或者: from tests.profile_utils.GSoCProfileHelper import createStudent [as 别名]
def testFeaturedProjectButton(self):
self.timeline.studentsAnnounced()
student = GSoCProfileHelper(self.gsoc, self.dev_test)
student.createOtherUser('[email protected]')
student.createStudent()
self.data.createOrgAdmin(self.org)
mentor = GSoCProfileHelper(self.gsoc, self.dev_test)
mentor.createOtherUser('[email protected]')
mentor_entity = mentor.createMentor(self.org)
project = self.createProject({'parent': self.data.profile,
'mentor': mentor_entity})
suffix = "%s/%s/%d" % (
self.gsoc.key().name(),
self.data.user.key().name(),
project.key().id())
url = '/gsoc/project/featured/' + suffix
postdata = {'value': 'unchecked'}
response = self.post(url, postdata)
self.assertResponseOK(response)
project = GSoCProject.all().get()
self.assertEqual(project.is_featured, True)
示例3: testReviewProposalPublicView
# 需要导入模块: from tests.profile_utils import GSoCProfileHelper [as 别名]
# 或者: from tests.profile_utils.GSoCProfileHelper import createStudent [as 别名]
def testReviewProposalPublicView(self):
student = GSoCProfileHelper(self.gsoc, self.dev_test)
student.createOtherUser('[email protected]')
student.createStudent()
proposal = self.createProposal({'is_publicly_visible': True,
'scope': student.profile,
'parent': student.profile})
suffix = "%s/%s/%d" % (
self.gsoc.key().name(),
student.user.key().name(),
proposal.key().id())
# test review GET
url = '/gsoc/proposal/review/' + suffix
response = self.get(url)
self.assertGSoCTemplatesUsed(response)
self.assertTemplateUsed(response, 'v2/modules/gsoc/proposal/review.html')
示例4: testWishToMentorButton
# 需要导入模块: from tests.profile_utils import GSoCProfileHelper [as 别名]
# 或者: from tests.profile_utils.GSoCProfileHelper import createStudent [as 别名]
def testWishToMentorButton(self):
student = GSoCProfileHelper(self.gsoc, self.dev_test)
student.createOtherUser('[email protected]')
student.createStudent()
self.data.createMentor(self.org)
other_mentor = self.createMentorWithSettings('[email protected]')
proposal = self.createProposal({'scope': student.profile,
'parent': student.profile})
suffix = "%s/%s/%d" % (
self.gsoc.key().name(),
student.user.key().name(),
proposal.key().id())
url = '/gsoc/proposal/wish_to_mentor/' + suffix
postdata = {'value': 'unchecked'}
response = self.post(url, postdata)
proposal = GSoCProposal.all().get()
self.assertTrue(self.data.profile.key() in proposal.possible_mentors)
postdata = {'value': 'checked'}
response = self.post(url, postdata)
proposal = GSoCProposal.all().get()
self.assertFalse(self.data.profile.key() in proposal.possible_mentors)
other_mentor.profile.mentor_for = []
other_mentor.profile.put()
proposal.possible_mentors.append(other_mentor.profile.key())
proposal.put()
url = '/gsoc/proposal/review/' + suffix
response = self.get(url)
proposal = GSoCProposal.all().get()
self.assertFalse(other_mentor.profile.key() in proposal.possible_mentors)
示例5: testCreateEvaluationForMentor
# 需要导入模块: from tests.profile_utils import GSoCProfileHelper [as 别名]
# 或者: from tests.profile_utils.GSoCProfileHelper import createStudent [as 别名]
def testCreateEvaluationForMentor(self):
link_id = LinkIDProvider(ProjectSurvey).getValue()
suffix = "%s/%s" % (self.gsoc.key().name(), link_id)
student_profile = GSoCProfileHelper(self.gsoc, self.dev_test)
student_profile.createOtherUser('[email protected]')
student = student_profile.createStudent()
self.data.createMentorWithProject(self.org, student)
# test review GET
url = '/gsoc/eval/student/edit/' + suffix
response = self.get(url)
self.assertResponseForbidden(response)
示例6: testAssignMentor
# 需要导入模块: from tests.profile_utils import GSoCProfileHelper [as 别名]
# 或者: from tests.profile_utils.GSoCProfileHelper import createStudent [as 别名]
def testAssignMentor(self):
student = GSoCProfileHelper(self.gsoc, self.dev_test)
student.createOtherUser('[email protected]')
student.createStudent()
proposal = self.createProposal({'scope': student.profile,
'parent': student.profile})
suffix = "%s/%s/%d" % (
self.gsoc.key().name(),
student.user.key().name(),
proposal.key().id())
self.data.createMentor(self.org)
url = '/gsoc/proposal/assign_mentor/' + suffix
postdata = {'assign_mentor': self.data.profile.key()}
response = self.post(url, postdata)
self.assertResponseForbidden(response)
proposal = GSoCProposal.all().get()
self.assertEqual(proposal.mentor, None)
示例7: testProposalModificationButton
# 需要导入模块: from tests.profile_utils import GSoCProfileHelper [as 别名]
# 或者: from tests.profile_utils.GSoCProfileHelper import createStudent [as 别名]
def testProposalModificationButton(self):
student = GSoCProfileHelper(self.gsoc, self.dev_test)
student.createOtherUser('[email protected]')
student.createStudent()
proposal = self.createProposal({'scope': student.profile,
'parent': student.profile})
suffix = "%s/%s/%d" % (
self.gsoc.key().name(),
student.user.key().name(),
proposal.key().id())
self.data.createMentor(self.org)
url = '/gsoc/proposal/modification/' + suffix
postdata = {'value': 'unchecked'}
response = self.post(url, postdata)
self.assertResponseOK(response)
proposal = GSoCProposal.all().get()
self.assertTrue(proposal.is_editable_post_deadline)
示例8: testIgnoreProposalButton
# 需要导入模块: from tests.profile_utils import GSoCProfileHelper [as 别名]
# 或者: from tests.profile_utils.GSoCProfileHelper import createStudent [as 别名]
def testIgnoreProposalButton(self):
student = GSoCProfileHelper(self.gsoc, self.dev_test)
student.createOtherUser('[email protected]')
student.createStudent()
proposal = self.createProposal({'scope': student.profile,
'parent': student.profile})
suffix = "%s/%s/%d" % (
self.gsoc.key().name(),
student.user.key().name(),
proposal.key().id())
self.data.createMentor(self.org)
url = '/gsoc/proposal/ignore/' + suffix
postdata = {'value': 'unchecked'}
response = self.post(url, postdata)
self.assertResponseForbidden(response)
proposal = GSoCProposal.all().get()
self.assertNotEqual(proposal.status, 'ignored')
示例9: createStudent
# 需要导入模块: from tests.profile_utils import GSoCProfileHelper [as 别名]
# 或者: from tests.profile_utils.GSoCProfileHelper import createStudent [as 别名]
def createStudent(self, email, program):
profile_helper = GSoCProfileHelper(program, dev_test=False)
profile_helper.createOtherUser(email)
student = profile_helper.createStudent()
return student