def setUpTestData(cls): cls.manager = AdviserManagerFactory() a_person_teacher = PersonFactory(first_name='Pierre', last_name='Dupont') cls.teacher = AdviserTeacherFactory(person=a_person_teacher) cls.person = PersonFactory() cls.manager2 = AdviserManagerFactory() a_person_student = PersonWithoutUserFactory(last_name="Durant") student = StudentFactory(person=a_person_student) offer_proposition = OfferPropositionFactory() cls.education_group_year = EducationGroupYearFactory(education_group=offer_proposition.education_group) FacultyAdviserFactory(adviser=cls.manager, education_group=cls.education_group_year.education_group) roles = [dissertation_role_status.PROMOTEUR, dissertation_role_status.CO_PROMOTEUR, dissertation_role_status.READER, dissertation_role_status.PROMOTEUR, dissertation_role_status.ACCOMPANIST, dissertation_role_status.PRESIDENT] status = [dissertation_status.DRAFT, dissertation_status.COM_SUBMIT, dissertation_status.EVA_SUBMIT, dissertation_status.TO_RECEIVE, dissertation_status.DIR_SUBMIT, dissertation_status.DIR_SUBMIT] for x in range(0, 6): proposition_dissertation = PropositionDissertationFactory(author=cls.teacher, creator=a_person_teacher, title='Proposition {}'.format(x) ) PropositionOfferFactory(proposition_dissertation=proposition_dissertation, offer_proposition=offer_proposition) DissertationFactory(author=student, title='Dissertation {}'.format(x), education_group_year=cls.education_group_year, proposition_dissertation=proposition_dissertation, status=status[x], active=True, dissertation_role__adviser=cls.teacher, dissertation_role__status=roles[x] )
def test_adviser_can_manage_dissertation(self): manager = AdviserManagerFactory() manager2 = AdviserManagerFactory() a_person_teacher = PersonFactory.create(first_name='Pierre', last_name='Dupont') a_person_teacher2 = PersonFactory.create(first_name='Marco', last_name='Millet') teacher = AdviserTeacherFactory(person=a_person_teacher) teacher2 = AdviserTeacherFactory(person=a_person_teacher2) a_person_student = PersonFactory.create(last_name="Durant", user=None) student = StudentFactory.create(person=a_person_student) offer_year_start = OfferYearFactory(academic_year=self.academic_year1, acronym="test_offer2") offer_year_start2 = OfferYearFactory(acronym="test_offer3", academic_year=offer_year_start.academic_year) offer = offer_year_start.offer offer2 = offer_year_start2.offer FacultyAdviserFactory(adviser=manager, offer=offer) create_faculty_adviser(manager, offer) create_faculty_adviser(manager2, offer2) proposition_dissertation = PropositionDissertationFactory(author=teacher, creator=a_person_teacher, title='Proposition1') dissertation = DissertationFactory(author=student, title='Dissertation 2017', offer_year_start=offer_year_start, proposition_dissertation=proposition_dissertation, status='DIR_SUBMIT', active=True, dissertation_role__adviser=teacher, dissertation_role__status='PROMOTEUR') self.assertEqual(adviser_can_manage(dissertation, manager), True) self.assertEqual(adviser_can_manage(dissertation, manager2), False) self.assertEqual(adviser_can_manage(dissertation, teacher), False)
def setUpTestData(cls): cls.person_manager = PersonFactory() cls.person_manager2 = PersonFactory() cls.manager = AdviserManagerFactory(person=cls.person_manager) cls.manager2 = AdviserManagerFactory(person=cls.person_manager2) cls.a_person_teacher = PersonFactory(first_name='Pierre', last_name='Dupont') cls.teacher = AdviserTeacherFactory(person=cls.a_person_teacher) cls.a_person_teacher2 = PersonFactory(first_name='Marco', last_name='Millet') cls.teacher2 = AdviserTeacherFactory(person=cls.a_person_teacher2) cls.teacher3 = AdviserTeacherFactory() cls.teacher4 = AdviserTeacherFactory() a_person_student = PersonWithoutUserFactory(last_name="Durant") cls.student = StudentFactory(person=a_person_student) cls.offer1 = EducationGroupFactory() cls.offer2 = EducationGroupFactory() cls.academic_year1 = AcademicYearFactory() cls.academic_year2 = AcademicYearFactory(year=cls.academic_year1.year - 1) cls.education_group_year1 = EducationGroupYearFactory( acronym="test_offer1", education_group=cls.offer1, academic_year=cls.academic_year1) cls.offer_proposition1 = OfferPropositionFactory( education_group=cls.offer1, global_email_to_commission=True, evaluation_first_year=True) cls.offer_proposition2 = OfferPropositionFactory( education_group=cls.offer2, global_email_to_commission=False) cls.proposition_dissertation = PropositionDissertationFactory( author=cls.teacher, creator=cls.a_person_teacher, title='Proposition 1212121') cls.faculty_adviser1 = FacultyAdviserFactory( adviser=cls.manager, education_group=cls.offer1) cls.faculty_adviser2 = FacultyAdviserFactory( adviser=cls.manager, education_group=cls.offer2) cls.dissertation1 = DissertationFactory( author=cls.student, title='Dissertation_test_email', education_group_year=cls.education_group_year1, proposition_dissertation=cls.proposition_dissertation, status='DIR_SUBMIT', active=True, dissertation_role__adviser=cls.teacher, dissertation_role__status='PROMOTEUR') DissertationRoleFactory(adviser=cls.teacher2, status='CO_PROMOTEUR', dissertation=cls.dissertation1) DissertationRoleFactory(adviser=cls.teacher3, status='READER', dissertation=cls.dissertation1)
def setUpTestData(cls): cls.person_manager = PersonFactory() cls.person_no_manager = PersonFactory() cls.person_manager2 = PersonFactory() cls.manager = AdviserManagerFactory(person=cls.person_manager) cls.manager2 = AdviserManagerFactory(person=cls.person_manager2) cls.a_person_teacher = PersonFactory() cls.teacher = AdviserTeacherFactory(person=cls.a_person_teacher) cls.teacher2 = AdviserTeacherFactory() cls.teacher3 = AdviserTeacherFactory() cls.a_person_student = PersonWithoutUserFactory() cls.student = StudentFactory(person=cls.a_person_student) cls.education_group = EducationGroupFactory() cls.education_group2 = EducationGroupFactory() cls.academic_year1 = AcademicYearFactory() cls.education_group_year = EducationGroupYearFactory( acronym="test_offer1", title="test_offer1", education_group=cls.education_group, academic_year=cls.academic_year1 ) cls.faculty_adviser1 = FacultyAdviserFactory( adviser=cls.manager, education_group=cls.education_group ) cls.faculty_adviser2 = FacultyAdviserFactory( adviser=cls.manager2, education_group=cls.education_group2 ) cls.proposition_dissertation = PropositionDissertationFactory(author=cls.teacher, creator=cls.teacher3.person) cls.offer_propo = OfferPropositionFactory(education_group=cls.education_group) cls.proposition_offer = PropositionOfferFactory( proposition_dissertation=cls.proposition_dissertation, offer_proposition=cls.offer_propo ) cls.dissertation1 = DissertationFactory( author=cls.student, education_group_year=cls.education_group_year, proposition_dissertation=cls.proposition_dissertation, status='DIR_SUBMIT', active=True, dissertation_role__adviser=cls.teacher, dissertation_role__status=dissertation_role_status.PROMOTEUR ) cls.dissertation_role = DissertationRoleFactory( adviser=cls.teacher3, status=dissertation_role_status.READER, dissertation=cls.dissertation1 )
def setUp(self): self.maxDiff = None self.manager = AdviserManagerFactory() a_person_teacher = PersonFactory.create(first_name='Pierre', last_name='Dupont') self.teacher = AdviserTeacherFactory(person=a_person_teacher) a_person_teacher2 = PersonFactory.create(first_name='Marco', last_name='Millet') self.teacher2 = AdviserTeacherFactory(person=a_person_teacher2) a_person_student = PersonFactory.create(last_name="Durant", user=None) student = StudentFactory.create(person=a_person_student) self.offer1 = OfferFactory(title="test_offer1") self.offer2 = OfferFactory(title="test_offer2") self.academic_year1 = AcademicYearFactory() self.academic_year2 = AcademicYearFactory(year=self.academic_year1.year-1) self.offer_year_start1 = OfferYearFactory(acronym="test_offer1", offer=self.offer1, academic_year=self.academic_year1) offer_year_start2 = OfferYearFactory(academic_year=self.academic_year2, acronym="test_offer2", offer=self.offer1) self.offer_proposition1 = OfferPropositionFactory(offer=self.offer1) self.offer_proposition2 = OfferPropositionFactory(offer=self.offer2) FacultyAdviserFactory(adviser=self.manager, offer=self.offer1) self.manager2 = AdviserManagerFactory() FacultyAdviserFactory(adviser=self.manager, offer=self.offer2) roles = ['PROMOTEUR', 'CO_PROMOTEUR', 'READER', 'PROMOTEUR', 'ACCOMPANIST', 'PRESIDENT'] status = ['DRAFT', 'COM_SUBMIT', 'EVA_SUBMIT', 'TO_RECEIVE', 'DIR_SUBMIT', 'DIR_SUBMIT'] self.dissertations_list = list() for x in range(0, 6): proposition_dissertation = PropositionDissertationFactory(author=self.teacher, creator=a_person_teacher, title='Proposition {}'.format(x) ) PropositionOfferFactory(proposition_dissertation=proposition_dissertation, offer_proposition=self.offer_proposition1) self.dissertations_list.append(DissertationFactory(author=student, title='Dissertation {}'.format(x), offer_year_start=self.offer_year_start1, proposition_dissertation=proposition_dissertation, status=status[x], active=True, dissertation_role__adviser=self.teacher, dissertation_role__status=roles[x] )) self.dissertation_1 = DissertationFactory\ (author=student, title='Dissertation 2017', offer_year_start=self.offer_year_start1, proposition_dissertation=proposition_dissertation, status='COM_SUBMIT', active=True, dissertation_role__adviser=self.teacher2, dissertation_role__status='PROMOTEUR')
def setUpTestData(cls): cls.manager = AdviserManagerFactory() a_person_teacher = PersonFactory(first_name='Pierre', last_name='Dupont') cls.teacher = AdviserTeacherFactory(person=a_person_teacher) a_person_student1 = PersonFactory(last_name="Durant", user=None) cls.student1 = StudentFactory(person=a_person_student1) a_person_student2 = PersonFactory(last_name="Robert", user=None) cls.student2 = StudentFactory(person=a_person_student2) cls.education_group1 = EducationGroupFactory() cls.current_academic_year = create_current_academic_year() cls.current_education_group_year = EducationGroupYearFactory( education_group=cls.education_group1, acronym="test_offer1", academic_year=cls.current_academic_year) cls.education_group2 = EducationGroupFactory() cls.education_group_year = EducationGroupYearFactory( education_group=cls.education_group2, academic_year=cls.current_academic_year) cls.academic_year2015 = AcademicYearFactory(year=2015) cls.education_group_year_2015 = EducationGroupYearFactory( acronym="test_offer1", education_group=cls.education_group1, academic_year=cls.academic_year2015) cls.offer_enrollment_curent_year = OfferEnrollmentFactory( student=cls.student1, education_group_year=cls.current_education_group_year, enrollment_state=offer_enrollment_state.SUBSCRIBED) cls.offer_enrollment2015 = OfferEnrollmentFactory( student=cls.student2, education_group_year=cls.education_group_year_2015, enrollment_state=offer_enrollment_state.SUBSCRIBED) cls.proposition_dissertation = PropositionDissertationFactory( author=cls.teacher, creator=a_person_teacher, title='Proposition de memoire') cls.dissertation_to_put_back_to_draft = DissertationFactory( author=cls.student1, education_group_year=cls.current_education_group_year, proposition_dissertation=cls.proposition_dissertation, status='DIR_SUBMIT', active=True, dissertation_role__adviser=cls.teacher, dissertation_role__status=dissertation_role_status.PROMOTEUR) cls.dissertation_test_count2015 = DissertationFactory( author=cls.student1, education_group_year=cls.education_group_year_2015, proposition_dissertation=cls.proposition_dissertation, status='COM_SUBMIT', active=True, dissertation_role__adviser=cls.teacher, dissertation_role__status=dissertation_role_status.PROMOTEUR) cls.dissertation_test_count2017 = DissertationFactory( author=cls.student2, education_group_year=cls.current_education_group_year, proposition_dissertation=cls.proposition_dissertation, status='COM_SUBMIT', active=True, dissertation_role__adviser=cls.teacher, dissertation_role__status=dissertation_role_status.PROMOTEUR)
def setUpTestData(cls): cls.maxDiff = None cls.manager = AdviserManagerFactory() a_person_teacher = PersonFactory(first_name='Pierre', last_name='Dupont') cls.teacher = AdviserTeacherFactory(person=a_person_teacher) a_person_student = PersonFactory(last_name="Durant") another_person_student = PersonFactory(last_name="Paul") cls.student = StudentFactory.create(person=a_person_student) cls.student_with_1_dissertation = StudentFactory( person=another_person_student) cls.education_group1 = EducationGroupFactory() cls.academic_year1 = AcademicYearFactory() cls.education_group_year1 = EducationGroupYearFactory( acronym="test_offer1", education_group=cls.education_group1, academic_year=cls.academic_year1) cls.offer_proposition1 = OfferPropositionFactory( education_group=cls.education_group1) cls.proposition_dissertation = PropositionDissertationFactory( author=cls.teacher, creator=a_person_teacher, title='Proposition 1212121') cls.proposition_dissertation2 = PropositionDissertationFactory( author=cls.teacher, creator=a_person_teacher, title='Proposition 1212121')
def setUp(self): self.maxDiff = None self.manager = AdviserManagerFactory() a_person_teacher = PersonFactory.create( first_name='Pierre', last_name='Dupont', email='*****@*****.**') self.teacher = AdviserTeacherFactory(person=a_person_teacher) a_person_teacher2 = PersonFactory.create( first_name='Marco', last_name='Millet', email='*****@*****.**') self.teacher2 = AdviserTeacherFactory(person=a_person_teacher2) self.teacher3 = AdviserTeacherFactory() self.teacher4 = AdviserTeacherFactory() a_person_student = PersonFactory.create( last_name="Durant", user=None, email='*****@*****.**') self.student = StudentFactory.create(person=a_person_student) self.offer1 = OfferFactory(title="test_offer1") self.offer2 = OfferFactory(title="test_offer2") self.academic_year1 = AcademicYearFactory() self.academic_year2 = AcademicYearFactory( year=self.academic_year1.year - 1) self.offer_year_start1 = OfferYearFactory( acronym="test_offer1", offer=self.offer1, academic_year=self.academic_year1) self.offer_year_start2 = OfferYearFactory( acronym="test_offer2", offer=self.offer2, academic_year=self.academic_year1) self.offer_proposition1 = OfferPropositionFactory( offer=self.offer1, global_email_to_commission=True, evaluation_first_year=True) self.offer_proposition2 = OfferPropositionFactory( offer=self.offer2, global_email_to_commission=False) self.proposition_dissertation = PropositionDissertationFactory( author=self.teacher, creator=a_person_teacher, title='Proposition 1212121') FacultyAdviserFactory(adviser=self.manager, offer=self.offer1) self.dissertation1 = DissertationFactory( author=self.student, title='Dissertation_test_email', offer_year_start=self.offer_year_start1, proposition_dissertation=self.proposition_dissertation, status='DIR_SUBMIT', active=True, dissertation_role__adviser=self.teacher, dissertation_role__status='PROMOTEUR') DissertationRoleFactory(adviser=self.teacher2, status='CO_PROMOTEUR', dissertation=self.dissertation1) DissertationRoleFactory(adviser=self.teacher3, status='READER', dissertation=self.dissertation1)
def setUp(self): self.manager = AdviserManagerFactory() self.teacher1 = AdviserTeacherFactory() self.teacher2 = AdviserTeacherFactory() self.proposition = PropositionDissertationFactory(author=self.teacher1) self.proposition_document = PropositionDocumentFileFactory( proposition=self.proposition)
def setUpTestData(cls): cls.manager = AdviserManagerFactory() cls.proposition = PropositionDissertationFactory() cls.dissertation = DissertationFactory( proposition_dissertation=cls.proposition) cls.proposition_offer = PropositionOfferFactory( proposition_dissertation=cls.proposition) FacultyAdviserFactory(adviser=cls.manager, education_group=cls.proposition_offer. offer_proposition.education_group)
def setUpTestData(cls): # Teacher cls.adviser_teacher = test_adviser.create_adviser_from_scratch( username='******', email='*****@*****.**', password='******', type='PRF') # Manager cls.adviser_manager = test_adviser.create_adviser_from_scratch( username='******', email='*****@*****.**', password='******', type='MGR') cls.teacher = AdviserTeacherFactory() cls.manager = AdviserManagerFactory() cls.education_group = EducationGroupFactory() cls.faculty_manager = FacultyAdviserFactory(adviser=cls.manager, education_group=cls.education_group) cls.offer_proposition = test_offer_proposition.create_offer_proposition(acronym="TEST_OFFER_NOW", education_group=cls.education_group) cls.prop_diss = PropositionDissertationFactory( title="Teacher proposition ", author=cls.teacher, creator=cls.teacher.person) cls.prop_offer = PropositionOfferFactory( proposition_dissertation=cls.prop_diss, offer_proposition=cls.offer_proposition ) cls.prop_role1 = PropositionRoleFactory( status="PROMOTEUR", adviser=cls.teacher, proposition_dissertation=cls.prop_diss ) # Create multiple propositions dissertations cls.teacher_propositon_dissertations = [] cls.manager_proposition_dissertations = [] for x in range(0, 5): # Teacher proposition dissertation creation teacher_prop = test_proposition_dissertation.create_proposition_dissertation( title="Teacher proposition " + str(x), adviser=cls.adviser_teacher, person=cls.adviser_teacher.person, offer_proposition=cls.offer_proposition) cls.teacher_propositon_dissertations.append(teacher_prop) # Manager proposition dissertation creation manager_prop = test_proposition_dissertation.create_proposition_dissertation( title="Manager propostion " + str(x), adviser=cls.adviser_manager, person=cls.adviser_manager.person, offer_proposition=cls.offer_proposition) cls.manager_proposition_dissertations.append(manager_prop) cls.proposition_dissertation_deactivated = PropositionDissertationFactory( title="It's deactivated", active=False )
def setUp(self): self.manager = AdviserManagerFactory() self.education_group = EducationGroupFactory() self.academic_year = create_current_academic_year() self.education_group_year = EducationGroupYearFactory( education_group=self.education_group, academic_year=self.academic_year) self.faculty_adviser = FacultyAdviserFactory( adviser=self.manager, education_group=self.education_group) self.dissertation = DissertationFactory( education_group_year=self.education_group_year) self.dissertation_document = DissertationDocumentFileFactory( dissertation=self.dissertation)
def setUpTestData(cls): cls.maxDiff = None cls.manager = AdviserManagerFactory() a_person_teacher = PersonFactory.create(first_name='Pierre', last_name='Dupont', email='*****@*****.**') cls.teacher = AdviserTeacherFactory(person=a_person_teacher) a_person_teacher2 = PersonFactory.create(first_name='Marco', last_name='Millet', email='*****@*****.**') cls.teacher2 = AdviserTeacherFactory(person=a_person_teacher2) a_person_student = PersonWithoutUserFactory.create( last_name="Durant", email='*****@*****.**') cls.student = StudentFactory.create(person=a_person_student) cls.education_group_1 = EducationGroupFactory() cls.academic_year1 = AcademicYearFactory() cls.education_group_year_1 = EducationGroupYearFactory( acronym="test_offer1", education_group=cls.education_group_1, academic_year=cls.academic_year1, title="test_offer1") cls.offer_proposition1 = OfferPropositionFactory( education_group=cls.education_group_1, global_email_to_commission=True) cls.proposition_dissertation = PropositionDissertationFactory( author=cls.teacher, creator=a_person_teacher, title='Proposition 1212121') FacultyAdviserFactory(adviser=cls.manager, education_group=cls.education_group_1) cls.dissertation_1 = DissertationFactory( author=cls.student, title='Dissertation_test_email', education_group_year=cls.education_group_year_1, proposition_dissertation=cls.proposition_dissertation, status='DRAFT', active=True, dissertation_role__adviser=cls.teacher, dissertation_role__status='PROMOTEUR') FacultyAdviserFactory(adviser=cls.manager, education_group=cls.education_group_1) cls.dissert_role = DissertationRoleFactory( dissertation=cls.dissertation_1, adviser=cls.teacher2, status='READER')
def setUp(self): self.manager = AdviserManagerFactory() a_person_teacher = PersonFactory(first_name='Pierre', last_name='Dupont') self.teacher = AdviserTeacherFactory(person=a_person_teacher) a_person_student = PersonFactory(last_name="Durant", user=None) student = StudentFactory(person=a_person_student) offer_year_start = OfferYearFactory(acronym="test_offer") offer = offer_year_start.offer offer_proposition = OfferPropositionFactory(offer=offer) FacultyAdviserFactory(adviser=self.manager, offer=offer) roles = [ 'PROMOTEUR', 'CO_PROMOTEUR', 'READER', 'PROMOTEUR', 'ACCOMPANIST', 'PRESIDENT' ] status = [ 'DRAFT', 'COM_SUBMIT', 'EVA_SUBMIT', 'TO_RECEIVE', 'DIR_SUBMIT', 'DIR_SUBMIT' ] for x in range(0, 6): proposition_dissertation = PropositionDissertationFactory( author=self.teacher, creator=a_person_teacher, title='Proposition {}'.format(x)) PropositionOfferFactory( proposition_dissertation=proposition_dissertation, offer_proposition=offer_proposition) DissertationFactory( author=student, title='Dissertation {}'.format(x), offer_year_start=offer_year_start, proposition_dissertation=proposition_dissertation, status=status[x], active=True, dissertation_role__adviser=self.teacher, dissertation_role__status=roles[x])
def setUpTestData(cls): cls.person = PersonFactory() cls.manager = AdviserManagerFactory(person=cls.person) cls.education_group = EducationGroupFactory() cls.education_group2 = EducationGroupFactory() cls.education_group_year = EducationGroupYearFactory( education_group=cls.education_group) cls.education_group_year2 = EducationGroupYearFactory( education_group=cls.education_group2) cls.faculty_manager = FacultyAdviserFactory( adviser=cls.manager, education_group=cls.education_group2) cls.faculty_manager2 = FacultyAdviserFactory( adviser=cls.manager, education_group=cls.education_group) cls.offer_proposition = OfferPropositionFactory( pk=12, education_group=cls.education_group, start_visibility_proposition="2018-12-12", end_visibility_proposition="2019-12-12", start_visibility_dissertation="2018-12-12", end_visibility_dissertation="2019-12-12", start_jury_visibility="2018-12-12", end_jury_visibility="2019-12-12", start_edit_title="2018-12-12", end_edit_title="2019-12-12", ) cls.offer_proposition2 = OfferPropositionFactory( pk=15, education_group=cls.education_group2, start_visibility_proposition="2018-12-12", end_visibility_proposition="2019-12-12", start_visibility_dissertation="2018-12-12", end_visibility_dissertation="2019-12-12", start_jury_visibility="2018-12-12", end_jury_visibility="2019-12-12", start_edit_title="2018-12-12", end_edit_title="2019-12-12", )
def setUpTestData(cls): cls.manager = AdviserManagerFactory() a_person_teacher = PersonFactory.create(first_name='Pierre', last_name='Dupont') cls.teacher = AdviserTeacherFactory(person=a_person_teacher)
def setUpTestData(cls): cls.maxDiff = None cls.manager = AdviserManagerFactory() a_person_teacher = PersonFactory.create( first_name='Pierre', last_name='Dupont', email='*****@*****.**') cls.teacher = AdviserTeacherFactory(person=a_person_teacher) a_person_teacher2 = PersonFactory.create( first_name='Marco', last_name='Millet', email='*****@*****.**') cls.teacher2 = AdviserTeacherFactory(person=a_person_teacher2) a_person_student = PersonWithoutUserFactory.create( last_name="Durant", email='*****@*****.**') cls.student = StudentFactory.create(person=a_person_student) cls.education_group = EducationGroupFactory() cls.education_group3 = EducationGroupFactory() cls.academic_year1 = create_current_academic_year() cls.academic_year2 = AcademicYearFactory(year=cls.academic_year1.year - 1) cls.education_group_year = EducationGroupYearFactory( academic_year=cls.academic_year1, education_group=cls.education_group, acronym="test_offer1") cls.faculty_manager = FacultyAdviserFactory( adviser=cls.manager, education_group=cls.education_group) cls.offer_proposition1 = OfferPropositionFactory( global_email_to_commission=True, evaluation_first_year=True, education_group=cls.education_group_year.education_group) cls.offer_proposition2 = OfferPropositionFactory( education_group=cls.education_group3, global_email_to_commission=False) cls.education_group_year2 = EducationGroupYearFactory( acronym="test_offer2", education_group=cls.offer_proposition2.education_group, academic_year=cls.academic_year1) cls.proposition_dissertation = PropositionDissertationFactory( author=cls.teacher, creator=a_person_teacher, title='Proposition 1212121') cls.dissertation_test_email = DissertationFactory( author=cls.student, title='Dissertation_test_email', proposition_dissertation=cls.proposition_dissertation, status='DRAFT', active=True, dissertation_role__adviser=cls.teacher, dissertation_role__status='PROMOTEUR', education_group_year=cls.education_group_year, ) FacultyAdviserFactory( adviser=cls.manager, education_group=cls.education_group_year.education_group) cls.manager2 = AdviserManagerFactory() FacultyAdviserFactory( adviser=cls.manager, education_group=cls.education_group_year2.education_group) FacultyAdviserFactory( adviser=cls.manager, education_group=cls.education_group_year.education_group) roles = [ 'PROMOTEUR', 'CO_PROMOTEUR', 'READER', 'PROMOTEUR', 'ACCOMPANIST', 'PRESIDENT' ] status = [ 'DRAFT', 'COM_SUBMIT', 'EVA_SUBMIT', 'TO_RECEIVE', 'DIR_SUBMIT', 'DIR_SUBMIT' ] cls.dissertations_list = list() for x in range(0, 6): proposition_dissertation = PropositionDissertationFactory( author=cls.teacher, creator=a_person_teacher, title='Proposition {}'.format(x)) PropositionOfferFactory( proposition_dissertation=proposition_dissertation, offer_proposition=cls.offer_proposition1) cls.dissertations_list.append( DissertationFactory( author=cls.student, title='Dissertation {}'.format(x), education_group_year=cls.education_group_year, proposition_dissertation=proposition_dissertation, status=status[x], active=True, dissertation_role__adviser=cls.teacher, dissertation_role__status=roles[x])) cls.dissertation_1 = DissertationFactory( author=cls.student, title='Dissertation 2017', education_group_year=cls.education_group_year, proposition_dissertation=cls.proposition_dissertation, status='COM_SUBMIT', active=True, dissertation_role__adviser=cls.teacher2, dissertation_role__status='PROMOTEUR') cls.url = reverse('manager_dissertations_search')
def setUp(self): self.manager = AdviserManagerFactory() a_person_teacher = PersonFactory.create(first_name='Pierre', last_name='Dupont') self.teacher = AdviserTeacherFactory(person=a_person_teacher)
def setUpTestData(cls): cls.manager = AdviserManagerFactory() a_person_teacher = PersonFactory(first_name='Pierre', last_name='Dupont', phone_mobile="0472760003") cls.teacher = AdviserTeacherFactory(person=a_person_teacher) cls.person = PersonFactory() cls.manager2 = AdviserManagerFactory()