Commit 96a48b36 authored by 小刘's avatar 小刘

选课中心班级详情测试用例

parent 5a80c2c3
...@@ -360,7 +360,7 @@ class TestChooseClasses: ...@@ -360,7 +360,7 @@ class TestChooseClasses:
time.sleep(2) time.sleep(2)
choose_data = ChooseClasses(server=self.server, studentId=userId, schoolAreaId=self.schoolArea).choose_class() choose_data = ChooseClasses(server=self.server, studentId=userId, schoolAreaId=self.schoolArea).choose_class()
with assume: assert choose_data['code'] == 0 with assume: assert choose_data['code'] == 0
with assume: assert '极趣班' not in jsonpath.jsonpath(choose_data, '$..classType') with assume: assert '极趣班' in jsonpath.jsonpath(choose_data, '$..classType')
with assume: assert '专题' in jsonpath.jsonpath(choose_data, '$..classType') with assume: assert '专题' in jsonpath.jsonpath(choose_data, '$..classType')
with assume: assert '新生' not in jsonpath.jsonpath(choose_data, '$..classType') with assume: assert '新生' not in jsonpath.jsonpath(choose_data, '$..classType')
with assume: assert '一对一定制班' not in jsonpath.jsonpath(choose_data, '$..classType') with assume: assert '一对一定制班' not in jsonpath.jsonpath(choose_data, '$..classType')
...@@ -438,7 +438,7 @@ class TestChooseClasses: ...@@ -438,7 +438,7 @@ class TestChooseClasses:
def test_choose_one_buy_class_two_show(self): def test_choose_one_buy_class_two_show(self):
userId_list = [] userId_list = []
for student_count in range(2): for student_count in range(2):
studentPho = '1783' + str(time.time()).split('.')[1] studentPho = '167' + datetime.datetime.now().strftime('%d%H%M%S')
students_data = CreateStudent(server=self.server, contactInfo=studentPho).create_student() students_data = CreateStudent(server=self.server, contactInfo=studentPho).create_student()
userId = students_data['data']['list'][0]['studentId'] userId = students_data['data']['list'][0]['studentId']
userId_list.append(userId) userId_list.append(userId)
...@@ -479,10 +479,11 @@ class TestChooseClasses: ...@@ -479,10 +479,11 @@ class TestChooseClasses:
def test_choose_one_buy_now_class_two_not_show(self): def test_choose_one_buy_now_class_two_not_show(self):
userId_list = [] userId_list = []
for student_count in range(2): for student_count in range(2):
studentPho = '1782' + str(time.time()).split('.')[1] studentPho = '177' + datetime.datetime.now().strftime('%d%H%M%S')
students_data = CreateStudent(server=self.server, contactInfo=studentPho).create_student() students_data = CreateStudent(server=self.server, contactInfo=studentPho).create_student()
userId = students_data['data']['list'][0]['studentId'] userId = students_data['data']['list'][0]['studentId']
userId_list.append(userId) userId_list.append(userId)
time.sleep(0.5)
course_id = CreateCourse(server=self.server, course_id = CreateCourse(server=self.server,
productType='主线课程', productType='主线课程',
classType='新生', classType='新生',
...@@ -518,10 +519,11 @@ class TestChooseClasses: ...@@ -518,10 +519,11 @@ class TestChooseClasses:
def test_choose_one_buy_groove_two_show(self): def test_choose_one_buy_groove_two_show(self):
userId_list = [] userId_list = []
for student_count in range(2): for student_count in range(2):
studentPho = '1731' + str(time.time()).split('.')[1] studentPho = '188' + datetime.datetime.now().strftime('%d%H%M%S')
students_data = CreateStudent(server=self.server, contactInfo=studentPho).create_student() students_data = CreateStudent(server=self.server, contactInfo=studentPho).create_student()
userId = students_data['data']['list'][0]['studentId'] userId = students_data['data']['list'][0]['studentId']
userId_list.append(userId) userId_list.append(userId)
time.sleep(0.5)
class_list = [] class_list = []
for class_count in range(2): for class_count in range(2):
course_id = CreateCourse(server=self.server, course_id = CreateCourse(server=self.server,
......
...@@ -179,4 +179,4 @@ class TestAuthUpdateChooseClass: ...@@ -179,4 +179,4 @@ class TestAuthUpdateChooseClass:
with assume: assert choose_data.get('code') == 0 with assume: assert choose_data.get('code') == 0
with assume: assert assert_data.get('price') == 100.0 with assume: assert assert_data.get('price') == 100.0
with assume: assert assert_data.get('amount') == 100.0 with assume: assert assert_data.get('amount') == 100.0
with assume: assert assert_data.get('1000') == 1000.0 with assume: assert assert_data.get('normalPrice') == 1000.0
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment