Beispiel #1
0
    def testDashboardAsStudentWithEval(self):
        user = profile_utils.seedNDBUser()
        profile_utils.loginNDB(user)
        profile = profile_utils.seedNDBStudent(self.program, user=user)

        project_utils.seedProject(profile, self.program.key())

        url = '/gsoc/dashboard/' + self.gsoc.key().name()
        response = self.get(url)
        self.assertResponseOK(response)
        self.assertDashboardComponentTemplatesUsed(response)
        response = self.getListResponse(url, 3)
        self.assertResponseForbidden(response)

        response = self.get(url)
        self.assertResponseOK(response)
        self.assertDashboardComponentTemplatesUsed(response)
        self.evaluation = SurveyHelper(self.gsoc, self.dev_test)
        self.evaluation.createStudentEvaluation(
            override={'link_id': 'midterm'})
        response = self.getListResponse(url, 3)
        self.assertIsJsonResponse(response)
        data = json.loads(response.content)
        self.assertEqual(len(data['data']['']), 1)

        self.evaluation.createStudentEvaluation(override={'link_id': 'final'})
        response = self.getListResponse(url, 3)
        self.assertIsJsonResponse(response)
        data = json.loads(response.content)
        self.assertEqual(len(data['data']['']), 2)
    def testDashboardAsStudentWithEval(self):
        mentor = GSoCProfileHelper(self.gsoc, self.dev_test)
        mentor.createOtherUser('*****@*****.**').createMentor(self.org)
        self.data.createStudentWithProject(self.org, mentor.profile)
        url = '/gsoc/dashboard/' + self.gsoc.key().name()
        response = self.get(url)
        self.assertDashboardComponentTemplatesUsed(response)
        response = self.getListResponse(url, 3)
        self.assertResponseForbidden(response)

        response = self.get(url)
        self.assertDashboardComponentTemplatesUsed(response)
        self.evaluation = SurveyHelper(self.gsoc, self.dev_test)
        self.evaluation.createStudentEvaluation(
            override={'link_id': 'midterm'})
        response = self.getListResponse(url, 3)
        self.assertIsJsonResponse(response)
        data = json.loads(response.content)
        self.assertEqual(len(data['data']['']), 1)

        self.evaluation.createStudentEvaluation(override={'link_id': 'final'})
        response = self.getListResponse(url, 3)
        self.assertIsJsonResponse(response)
        data = json.loads(response.content)
        self.assertEqual(len(data['data']['']), 2)
Beispiel #3
0
 def setUp(self):
     self.init()
     self.record = SurveyHelper(self.gci, self.dev_test, self.org_app)
Beispiel #4
0
 def setUp(self):
   super(StudentEvaluationTest, self).setUp()
   self.init()
   self.evaluation = SurveyHelper(self.gsoc, self.dev_test)
Beispiel #5
0
 def setUp(self):
     super(GCIOrgAppRecordsPageTest, self).setUp()
     self.init()
     self.record = SurveyHelper(self.gci, self.dev_test, self.org_app)
     self.url = '/gci/org/application/records/%s' % self.gci.key().name()