def setUp(self): semester_data = get_semester_data() semester = Semester.objects.create(**semester_data) self.clazz_data = get_clazz_data() self.clazz = Clazz.objects.create(semester=semester, **self.clazz_data) self.activity_data = get_activity_data() self.activity = Activity.objects.create(**self.activity_data)
def setUp(self): self.activities_data = [] self.activities = [] self.students_data = [] self.students = [] # 生成三个活动 for i in range(0, 3): activity_data = get_activity_data() activity = Activity(**activity_data) activity.save() self.activities_data.append(activity_data) self.activities.append(activity) # 生成8个学生 company_data = get_company_data() company = Company(**company_data) company.save() for i in range(0, 8): # make pylint happy if i == -1: pass student_data = get_student_data() student = Student(company=company, **student_data) student.save() self.students_data.append(student_data) self.students.append(student)
def setUp(self): self.activities = [] for i in range(0, 3): if i == -1: pass activity_data = get_activity_data() activity_data['state'] = activity_state.ENROLLING activity = Activity.objects.create(**activity_data) self.activities.append(activity) self.student = get_student() self.another_student = get_student() for activity in self.activities: ActivityStudent.objects.create(activity=activity, student=self.student) ActivityStudent.objects.create(activity=activity, student=self.another_student) # 添加一个额外的学生和活动 activity_data = get_activity_data() activity = Activity.objects.create(**activity_data) ActivityStudent.objects.create(activity=activity, student=self.another_student)
def setUp(self): self.activity_clazzes = [] semester_data = get_semester_data() semester = Semester.objects.create(**semester_data) self.activity_data = get_activity_data() self.activity = Activity.objects.create(**self.activity_data) self.clazzes = [] self.clazzes_data = [] for i in range(0, 8): clazz_data = obtain_clazz_data() clazz = Clazz.objects.create(semester=semester, **clazz_data) self.clazzes.append(clazz) self.clazzes_data.append(clazz_data) if i < 5: activity_clazz = ActivityClazz.objects.create( activity=self.activity, clazz=self.clazzes[i]) self.activity_clazzes.append(activity_clazz)
def setUp(self): self.activity_data = get_activity_data() activity = Activity(**self.activity_data) activity.save() self.activity = activity
def setUp(self): self.activity_data = get_activity_data() self.activity = Activity.objects.create(**self.activity_data)
def setUp(self): self.activity_data = get_activity_data()