def setUpTestData(cls): with mute_signals(post_save): # valid profiles cls.expected_in_progress_profiles = ExamProfileFactory.create_batch(5, status=ExamProfile.PROFILE_PENDING) # invalid profiles cls.expected_invalid_profiles = ExamProfileFactory.create_batch(5, status=ExamProfile.PROFILE_PENDING) cls.all_profiles = cls.expected_in_progress_profiles + cls.expected_invalid_profiles
def setUpTestData(cls): with mute_signals(post_save): # valid profiles cls.expected_in_progress_profiles = ExamProfileFactory.create_batch( 5, status=ExamProfile.PROFILE_PENDING) # invalid profiles cls.expected_invalid_profiles = ExamProfileFactory.create_batch( 5, status=ExamProfile.PROFILE_PENDING) cls.all_profiles = cls.expected_in_progress_profiles + cls.expected_invalid_profiles
def setUpTestData(cls): sftp = Mock() cls.now = now_in_utc() cls.processor = download.ArchivedResponseProcessor(sftp) with mute_signals(post_save): cls.success_profiles = ExamProfileFactory.create_batch(2) + [ ExamProfileFactory.create( profile__id=999, profile__student_id=1000), # disjoint id and student_id ] cls.failure_profiles = ExamProfileFactory.create_batch(2) cls.success_results = ([ VCDCResult( client_candidate_id=exam_profile.profile.student_id, status=VCDC_SUCCESS_STATUS, date=cls.now, message='', ) for exam_profile in cls.success_profiles ], []) cls.failed_results = ([ VCDCResult( client_candidate_id=cls.failure_profiles[0].profile.student_id, status=VCDC_FAILURE_STATUS, date=cls.now, message='', ), VCDCResult( client_candidate_id=cls.failure_profiles[1].profile.student_id, status=VCDC_FAILURE_STATUS, date=cls.now, message='Bad address', ), ], []) cls.all_results = ( cls.success_results[0] + cls.failed_results[0], cls.success_results[1] + cls.failed_results[1], )
def setUpTestData(cls): sftp = Mock() cls.now = now_in_utc() cls.processor = download.ArchivedResponseProcessor(sftp) with mute_signals(post_save): cls.success_profiles = ExamProfileFactory.create_batch(2) + [ ExamProfileFactory.create(profile__id=999, profile__student_id=1000), # disjoint id and student_id ] cls.failure_profiles = ExamProfileFactory.create_batch(2) cls.success_results = ([ VCDCResult( client_candidate_id=exam_profile.profile.student_id, status=VCDC_SUCCESS_STATUS, date=cls.now, message='', ) for exam_profile in cls.success_profiles ], []) cls.failed_results = ([ VCDCResult( client_candidate_id=cls.failure_profiles[0].profile.student_id, status=VCDC_FAILURE_STATUS, date=cls.now, message='', ), VCDCResult( client_candidate_id=cls.failure_profiles[1].profile.student_id, status=VCDC_FAILURE_STATUS, date=cls.now, message='Bad address', ), ], []) cls.all_results = ( cls.success_results[0] + cls.failed_results[0], cls.success_results[1] + cls.failed_results[1], )