Exemple #1
0
 def test_p1_step01_type13_analogtea_submithomework(self):
     """
     title: 验证教师端提交模拟选科问卷,查看布置成功模拟选科信息_高一3+3 固定套餐
     url: /api/teacher/analogselectionfortea/submithomework,/api/teacher/analogselectionfortea/getsuccesshomeworkdetail
     author: 章志君
     """
     teacher_web = teacher(web_client(username=principal_user['username']))
     title = '高一3+3 固定套餐模拟选科问卷'
     groups = []
     res = teacher_web.analogtea_getquestionnaireinfo(grade=1, type=3)
     for i in res['data']['subjectlist']:
         groups.append(i['id'])
     res = teacher_web.analogtea_submithomework(
         grade=1,
         type=3,
         title=title,
         subjectgroups=groups,
         endtime=CaseServices.get_deadlinetime())
     print(res)
     self.assertEqual(200, res['code'])
     self.assertEqual("执行成功", res['msg'])
     self.assertTrue(res['data'] > 1)
     # homeworkids_type[3] = res['data']
     res2 = teacher_web.analogtea_getsuccesshomeworkdetail(
         homeworkid=res['data'])
     print(res2)
     self.assertEqual(200, res2['code'])
     self.assertEqual("执行成功", res2['msg'])
     self.assertEqual(3, res2['data']['type'])
     self.assertEqual(title, res2['data']['title'])
     # self.assertEqual(tomorrow_time, res2['data']['endtime'])
     self.assertTrue(res2['data']['peoplenum'] >= 2)
Exemple #2
0
 def __analogtea_submithomework(self, type):
     teacher_web = teacher(web_client(username=principal_user['username']))
     title = '模拟选科问卷type{}'.format(type)
     groups = []
     res = teacher_web.analogtea_getquestionnaireinfo(grade=1, type=type)
     for i in res['data']['subjectlist']:
         groups.append(i['id'])
     res = teacher_web.analogtea_submithomework(
         grade=1,
         type=type,
         title=title,
         subjectgroups=groups,
         endtime=CaseServices.get_deadlinetime())
     return res['data']
Exemple #3
0
    def test_p2_homeworkurgestate(self):
        """
        title: 验证督学系统:催交及催交状态
        url: /api/eteacherproduct/routine/urge,/api/eteacherproduct/routine/urgeState
        author: 吴丽燕
        """
        teacher_principal = teacher(
            web_client(username=principal_user['username'],
                       password=principal_user['password']))
        components = [{
            "type": "1",
            "title": "testauto_video",
            "resourceIds": lesson_ids
        }]
        gradeClasses = [{
            "grade": grade,
            "expireYear": expireyear,
            "classList": [groupid_jiaoxue]
        }]
        res = teacher_principal.sethomework(
            components=components,
            gradeClasses=gradeClasses,
            deadline=CaseServices.get_deadlinetime(),
            arrangeType=0,
            classType=2,
            expireYears=[],
            isGradeHomework=False,
            subject='1')

        hid = res['data'][0]
        teacher_web = teacher(web_client(username=principal_user['username']))
        homeworkurgestateres = teacher_web.homeworkurgestate(homeworkId=hid)
        print(homeworkurgestateres)
        self.assertEqual('200', homeworkurgestateres['code'])
        self.assertEqual(0, homeworkurgestateres['data'])
        res = teacher_web.homeworkurge(homeworkId=hid)
        print(res)
        self.assertEqual('200', res['code'])
        self.assertTrue(res['data'] > 0)
        time.sleep(5)
        homeworkurgestateres = teacher_web.homeworkurgestate(homeworkId=hid)
        self.assertEqual(-1, homeworkurgestateres['data'])