def setUp(self):
        self.config_for_test()
        self.unit = unit_factory()
        self.activity = self.unit.discussion_forum
        self.course = MagicMock()

        # student recieiving the message
        self.author = student_factory()
        self.reviewer = student_factory()

        # This would be the content unit
        self.work = fake.text()
        # Set to none so that loader thinks not a quiz
        self.activity_id = self.unit.discussion_forum.id
        self.dao = SqliteDAO()
        self.session = self.dao.session
        self.create_new_and_preexisting_students()
        # Prepare fake work repo to give values to calling  objects

        # self.studentRepo = StudentRepository()
        # self.studentRepo.get_student = MagicMock( return_value=self.reviewer )
        self.contentRepo = ContentRepositoryMock()
        self.contentRepo.get_formatted_work_by = MagicMock(
            return_value=self.work)
        self.review_assign = MagicMock(assessor_id=self.reviewer.id,
                                       assessee_id=self.author.id)
        self.statusRepo = MagicMock()
        # Prepare fake work repo to give values to calling  objects
        self.workRepo = ContentRepositoryMock()
        self.workRepo.create_test_content(self.student_ids)
        self.workRepo.add_students_to_data(self.student_ids,
                                           make_dataframe=True)
예제 #2
0
    def setUp(self):
        self.config_for_test()
        self.dao = SqliteDAO()

        self.course = MagicMock()
        # review = Review(**activity_data_factory())
        self.unit = unit_factory()
예제 #3
0
    def test__set_access_code_for_next(self):
        unit = unit_factory()
        for c in unit.components:
            unit._set_access_code_for_next(c)

        # check
        self.assertEqual(unit.initial_work.access_code_for_next,
                         unit.review.access_code)
        self.assertEqual(unit.review.access_code_for_next,
                         unit.metareview.access_code)
    def setUp(self):
        dao = SqliteDAO()
        self.session = dao.session
        # self.student_ids = [i for i in range(0,5)]
        self.create_new_and_preexisting_students()

        self.unit = unit_factory()
        self.activity = self.unit.initial_work
        self.activity_id = self.activity.id
        self.obj = AssociationRepository(dao, self.activity)
    def setUp(self):
        self.config_for_test()
        self.dao = SqliteDAO()
        print("Connected to testing db")
        self.session = self.dao.session

        self.student = student_factory()
        self.unit = unit_factory()
        self.activity = fake.random.choice(self.unit.components)

        self.obj = StatusRepository(self.dao, self.activity)
 def setUp( self ):
     self.config_for_test()
     env.CONFIG.semester_name = "T30"
     self.unit = unit_factory()
     self.course = MagicMock()
     self.activity_id = self.unit.review.id
     # self.dao = SqliteDAO()
     self.create_new_and_preexisting_students()
     # Prepare fake work repo to give values to calling  objects
     self.workRepo = ContentRepositoryMock()
     self.workRepo.create_test_content( self.student_ids )
     self.workRepo.add_students_to_data(self.student_ids, make_dataframe=True)
예제 #7
0
    def setUp(self):
        self.config_for_test()
        self.unit = unit_factory()
        self.activity_data = activity_data_factory()
        self.activity = Activity(**self.activity_data)
        # student recieiving the message
        self.receiving_student = student_factory()
        self.reviewed_student_work = fake.text()

        self.studentRepo = StudentRepository()
        self.studentRepo.get_student = MagicMock(
            return_value=self.receiving_student)
        self.contentRepo = ContentRepositoryMock()
        self.statusRepo = create_autospec(StatusRepository)
예제 #8
0
    def setUp(self):
        self.config_for_test()
        self.unit = unit_factory()
        self.course = MagicMock()

        # Set to none so that loader thinks not a quiz
        self.unit.initial_work.quiz_id = None
        self.activity_id = self.unit.initial_work.id
        self.dao = SqliteDAO()
        self.session = self.dao.session
        self.create_new_and_preexisting_students()
        # Prepare fake work repo to give values to calling  objects
        self.workRepo = ContentRepositoryMock()
        self.workRepo.create_test_content(self.student_ids)
        self.workRepo.add_students_to_data(self.student_ids,
                                           make_dataframe=True)
    def setUp(self):
        self.config_for_test()
        self.unit = unit_factory()
        # self.activity_data = activity_data_factory()
        self.activity = self.unit.review  #InitialWork( **self.activity_data )

        # student recieiving the message
        self.author = student_factory()
        self.reviewer = student_factory()

        # This would be the content unit
        self.work = fake.text()

        self.studentRepo = StudentRepository()
        self.studentRepo.get_student = MagicMock(return_value=self.reviewer)
        self.contentRepo = ContentRepositoryMock()
        self.contentRepo.get_formatted_work_by = MagicMock(
            return_value=self.work)
        self.review_assign = MagicMock(assessor_id=self.reviewer.id,
                                       assessee_id=self.author.id)
        self.statusRepo = MagicMock()  #create_autospec(StatusRepository)
예제 #10
0
    def setUp( self ):
        self.config_for_test()
        self.unit = unit_factory()
        self.activity = self.unit.metareview

        # student receiving the message
        self.author = student_factory()
        self.reviewer = student_factory()

        # This would be the results of the peer review
        self.work = fake.text()

        self.studentRepo = StudentRepository()
        # self.studentRepo.data = {self.author.id : self.author,
        #                          self.reviewer.id: self.reviewer
        #                          }
        self.studentRepo.get_student = MagicMock( return_value=self.author )
        self.contentRepo = ContentRepositoryMock()
        self.contentRepo.get_formatted_work_by = MagicMock( return_value=self.work )
        self.statusRepo = create_autospec(InvitationStatusRepository)

        self.review_assign = MagicMock( assessor_id=self.reviewer.id, assessee_id=self.author.id )
예제 #11
0
    def setUp(self):
        self.config_for_test()
        self.unit = unit_factory()
        # self.activity_data = activity_data_factory()
        self.activity = self.unit.metareview  #InitialWork( **self.activity_data )

        self.author = student_factory()
        # student receiving the message (we are sending the feedback
        # created by the author of the content assignment)
        self.reviewer = student_factory()

        # This would be metareview feedback on the review
        self.work = fake.text()

        self.studentRepo = StudentRepository()
        self.studentRepo.get_student = MagicMock(return_value=self.reviewer)
        self.contentRepo = ContentRepositoryMock()
        self.contentRepo.get_formatted_work_by = MagicMock(
            return_value=self.work)

        self.review_assign = MagicMock(assessor_id=self.reviewer.id,
                                       assessee_id=self.author.id)
        self.statusRepo = create_autospec(FeedbackStatusRepository)
    def setUp( self ):
        self.config_for_test()
        self.dao = SqliteDAO()

        self.course = MagicMock()
        self.unit = unit_factory()
예제 #13
0
 def setUp(self):
     self.config_for_test()
     self.unit = unit_factory()
     self.course = MagicMock()
     self.activity_id = self.unit.review.id