def setUp(self): self.user = User.objects.create_user(username='******', password='******') self.client.login(username='******', password='******') self.course = Course(title='test_title', addedBy=self.user) self.course.save() self.unit = Unit(title='test unit title', addedBy=self.user) self.unit.save() self.course_unit = CourseUnit(course=self.course, unit=self.unit, order=0, addedBy=self.user) self.course_unit.save() self.role = Role(course=self.course, user=self.user, role=Role.INSTRUCTOR) self.role.save() self.concept = Concept.new_concept('bad', 'idea', self.unit, self.user) self.lesson = Lesson(title='New York Test Lesson', text='brr', addedBy=self.user) self.lesson.save_root(self.concept) self.unit_lesson = UnitLesson(unit=self.unit, lesson=self.lesson, addedBy=self.user, treeID=self.lesson.id) self.unit_lesson.save()
def setUp(self): self.user = User.objects.create_user(username='******', password='******') self.client.login(username='******', password='******') self.course = Course(title='test_title', addedBy=self.user) self.course.save() self.unit = Unit(title='test unit title', addedBy=self.user) self.unit.save() self.course_unit = CourseUnit( course=self.course, unit=self.unit, order=0, addedBy=self.user ) self.course_unit.releaseTime = timezone.now() - datetime.timedelta(days=1) self.course_unit.save() self.enroll = EnrollUnitCode(courseUnit=self.course_unit) self.enroll.save() self.role = Role(course=self.course, user=self.user, role=Role.INSTRUCTOR) self.role.save() self.student_role = Role(course=self.course, user=self.user, role=Role.ENROLLED) self.student_role.save() self.concept = Concept.new_concept('bad', 'idea', self.unit, self.user) self.lesson = Lesson( title='New York Test Lesson', text='brr', addedBy=self.user, kind=Lesson.ORCT_QUESTION ) self.lesson.save_root(self.concept) self.unit_lesson = UnitLesson( unit=self.unit, lesson=self.lesson, addedBy=self.user, treeID=self.lesson.id, order=0 ) self.unit_lesson.save() self.unit_lesson_answer = UnitLesson( parent=self.unit_lesson, unit=self.unit, lesson=self.lesson, addedBy=self.user, treeID=self.lesson.id, kind=UnitLesson.ANSWERS ) self.unit_lesson_answer.save() self.user = User.objects.create_user(username='******', password='******') call_command('fsm_deploy')
def setUp(self): self.client = Client() self.user = User.objects.create_user('test', '*****@*****.**', 'test') get_specs()[0].save_graph(self.user.username) get_specs_additional()[0].save_graph(self.user.username) get_specs_resource()[0].save_graph(self.user.username) self.unit = Unit(title='Test title', addedBy=self.user) self.unit.save() self.course = Course(title='Test title', description='test description', access='Public', enrollCode='111', lockout='222', addedBy=self.user) self.course.save() self.courseunit = CourseUnit( unit=self.unit, course=self.course, order=0, addedBy=self.user, releaseTime=timezone.now() ) self.courseunit.save() self.concept = Concept.new_concept('bad', 'idea', self.unit, self.user) lesson = Lesson(title='title', text='text', addedBy=self.user) lesson.save() self.unitlesson = UnitLesson( unit=self.unit, order=0, lesson=lesson, addedBy=self.user, treeID=lesson.id ) self.unitlesson.save() resource_lesson = Lesson( title='title for resource', text='text for resource', addedBy=self.user ) resource_lesson.save() self.resource_unitlesson = UnitLesson( unit=self.unit, lesson=resource_lesson, addedBy=self.user, treeID=resource_lesson.id ) self.resource_unitlesson.save()