def setUp(self): self.person_1 = test_person.create_person("person_1", last_name="test", email="*****@*****.**") self.person_2 = test_person.create_person("person_2", last_name="test", email="*****@*****.**") self.persons = [self.person_1, self.person_2] self.person_3 = PersonWithPermissionsFactory( "can_receive_emails_about_automatic_postponement") self.academic_year = test_academic_year.create_academic_year() test_academic_year.create_academic_year(year=self.academic_year.year - 1) self.learning_unit_year = LearningUnitYearFactory( acronym="TEST", specific_title="Cours de test", academic_year=self.academic_year) self.offer_year = test_offer_year.create_offer_year( "SINF2MA", "Master en Sciences Informatique", self.academic_year) self.exam_enrollment_1 = test_exam_enrollment.create_exam_enrollment_with_student( 1, "64641200", self.offer_year, self.learning_unit_year) self.exam_enrollment_2 = test_exam_enrollment.create_exam_enrollment_with_student( 2, "60601200", self.offer_year, self.learning_unit_year) self.msg_list = [ 'The partim TEST_A has been deleted for the year ' + str(self.academic_year.year), 'The partim TEST_B has been deleted for the year ' + str(self.academic_year.year), 'The class TEST_C has been deleted for the year ' + str(self.academic_year.year), 'The class TEST_A_C1 has been deleted for the year ' + str(self.academic_year.year), 'The class TEST_A_C2 has been deleted for the year ' + str(self.academic_year.year), 'The class TEST_B_C1 has been deleted for the year ' + str(self.academic_year.year), 'The class TEST_B_C2 has been deleted for the year ' + str(self.academic_year.year), 'The learning unit TEST has been successfully deleted for all years' ] self.egys_to_postpone = EducationGroupYear.objects.all() self.egys_already_existing = EducationGroupYear.objects.all() self.egys_ending_this_year = EducationGroupYear.objects.all() self.luys_to_postpone = LearningUnitYear.objects.all() self.luys_already_existing = LearningUnitYear.objects.all() self.luys_ending_this_year = LearningUnitYear.objects.all() add_message_template_html() add_message_template_txt()
def setUp(self): self.person_1 = test_person.create_person("person_1", last_name="test", email="*****@*****.**") self.person_2 = test_person.create_person("person_2", last_name="test", email="*****@*****.**") self.persons = [self.person_1, self.person_2] self.academic_year = test_academic_year.create_academic_year() self.learning_unit_year = LearningUnitYearFactory( acronym="TEST", title="Cours de test", academic_year=self.academic_year) self.offer_year = test_offer_year.create_offer_year( "SINF2MA", "Master en Sciences Informatique", self.academic_year) self.exam_enrollment_1 = test_exam_enrollment.create_exam_enrollment_with_student( 1, "64641200", self.offer_year, self.learning_unit_year) self.exam_enrollment_2 = test_exam_enrollment.create_exam_enrollment_with_student( 2, "60601200", self.offer_year, self.learning_unit_year) self.msg_list = [ 'The partim TEST_A has been deleted for the year ' + str(self.academic_year.year), 'The partim TEST_B has been deleted for the year ' + str(self.academic_year.year), 'The class TEST_C has been deleted for the year ' + str(self.academic_year.year), 'The class TEST_A_C1 has been deleted for the year ' + str(self.academic_year.year), 'The class TEST_A_C2 has been deleted for the year ' + str(self.academic_year.year), 'The class TEST_B_C1 has been deleted for the year ' + str(self.academic_year.year), 'The class TEST_B_C2 has been deleted for the year ' + str(self.academic_year.year), 'The learning unit TEST has been successfully deleted for all years' ] add_message_template_html() add_message_template_txt()
def setUp(self): self.person_1 = test_person.create_person("person_1", last_name="test", email="*****@*****.**") self.person_2 = test_person.create_person("person_2", last_name="test", email="*****@*****.**") self.persons = [self.person_1, self.person_2] academic_year = test_academic_year.create_academic_year() self.learning_unit_year = test_learning_unit_year.create_learning_unit_year("TEST", "Cours de test", academic_year) self.offer_year = test_offer_year.create_offer_year("SINF2MA", "Master en Sciences Informatique", academic_year) self.exam_enrollment_1 = test_exam_enrollment.create_exam_enrollment_with_student(1, "64641200", self.offer_year, self.learning_unit_year) self.exam_enrollment_2 = test_exam_enrollment.create_exam_enrollment_with_student(2, "60601200", self.offer_year, self.learning_unit_year) add_message_template_html() add_message_template_txt()
def setUpTestData(cls): cls.person_1 = test_person.create_person("person_1", last_name="test", email="*****@*****.**") cls.person_2 = test_person.create_person("person_2", last_name="test", email="*****@*****.**") cls.persons = [cls.person_1, cls.person_2] cls.person_3 = PersonWithPermissionsFactory( "can_receive_emails_about_automatic_postponement") cls.academic_year = test_academic_year.create_academic_year() test_academic_year.create_academic_year(year=cls.academic_year.year - 1) cls.learning_unit_year = LearningUnitYearFactory( acronym="TEST", specific_title="Cours de test", academic_year=cls.academic_year) cls.offer_year = test_offer_year.create_offer_year( "SINF2MA", "Master en Sciences Informatique", cls.academic_year) cls.exam_enrollment_1 = test_exam_enrollment.create_exam_enrollment_with_student( 1, "64641200", cls.offer_year, cls.learning_unit_year) cls.exam_enrollment_2 = test_exam_enrollment.create_exam_enrollment_with_student( 2, "60601200", cls.offer_year, cls.learning_unit_year) cls.msg_list = [ 'The partim TEST_A has been deleted for the year ' + str(cls.academic_year.year), 'The partim TEST_B has been deleted for the year ' + str(cls.academic_year.year), 'The class TEST_C has been deleted for the year ' + str(cls.academic_year.year), 'The class TEST_A_C1 has been deleted for the year ' + str(cls.academic_year.year), 'The class TEST_A_C2 has been deleted for the year ' + str(cls.academic_year.year), 'The class TEST_B_C1 has been deleted for the year ' + str(cls.academic_year.year), 'The class TEST_B_C2 has been deleted for the year ' + str(cls.academic_year.year), 'The learning unit TEST has been successfully deleted for all years' ] cls.egys_to_postpone = EducationGroupYear.objects.all() cls.egys_already_existing = EducationGroupYear.objects.all() cls.egys_ending_this_year = EducationGroupYear.objects.all() cls.luys_to_postpone = LearningUnitYear.objects.all() cls.luys_already_existing = LearningUnitYear.objects.all() cls.luys_ending_this_year = LearningUnitYear.objects.all() cls.ending_on_max_adjournment = LearningUnitYear.objects.all() cls.statistics_data = { 'max_academic_year_to_postpone': cls.academic_year, 'to_duplicate': cls.luys_to_postpone, 'already_duplicated': cls.luys_already_existing, 'to_ignore': cls.luys_ending_this_year, 'ending_on_max_academic_year': cls.ending_on_max_adjournment } add_message_template_html() add_message_template_txt()
def create_student_with_specific_registration_id(registration_id): a_student = mdl_base.student.Student(registration_id=registration_id, person=create_person()) a_student.save() return a_student
def create_student(registration_id="64641200"): a_student = mdl_base.student.Student(registration_id=registration_id, person=create_person()) a_student.save() return a_student
def create_student(first_name, last_name, registration_id): person = test_person.create_person(first_name, last_name) a_student = student.Student(person=person, registration_id=registration_id) a_student.save() return a_student
def create_tutor(): a_tutor = tutor.Tutor(person=test_person.create_person()) a_tutor.save() return a_tutor
def test_with_no_information_for_user(self): other_person = test_person.create_person("other", "another") student_information = mdl_student_information.find_by_person( other_person) self.assertFalse(student_information)