def setUp(self): self.user = UserFactory() self.user.user_permissions.add( Permission.objects.get(codename="can_access_learningunit")) self.user.user_permissions.add( Permission.objects.get(codename="can_edit_learningunit")) self.person = CentralManagerFactory(user=self.user) self.client.force_login(self.user) person_entity = PersonEntityFactory( person=self.person, entity=EntityVersionFactory().entity, ) self.academic_year = create_current_academic_year() luy = LearningUnitYearFullFactory( academic_year=self.academic_year, internship_subtype=None, acronym="EFAC0000", learning_container_year__container_type=EXTERNAL, learning_container_year__requirement_entity=person_entity.entity, ) self.external = ExternalLearningUnitYearFactory(learning_unit_year=luy) self.data = get_valid_external_learning_unit_form_data( self.academic_year, self.person, self.external.learning_unit_year) self.url = reverse(update_learning_unit, args=[self.external.learning_unit_year.pk])
def setUp(self): self.user = UserFactory() self.user.user_permissions.add( Permission.objects.get(codename="can_access_learningunit")) self.user.user_permissions.add( Permission.objects.get(codename="can_edit_learningunit")) self.person = CentralManagerFactory(user=self.user) self.client.force_login(self.user) self.academic_year = create_current_academic_year() luy = LearningUnitYearFullFactory(academic_year=self.academic_year) self.external = ExternalLearningUnitYearFactory(learning_unit_year=luy) luy.learning_container_year.container_type = EXTERNAL luy.learning_container_year.save() EntityVersionFactory(entity=self.external.requesting_entity) PersonEntityFactory(person=self.person, entity=self.external.requesting_entity) self.data = get_valid_external_learning_unit_form_data( self.academic_year, self.person, self.external.learning_unit_year) self.url = reverse(update_learning_unit, args=[self.external.learning_unit_year.pk])
def setUpTestData(cls): cls.user = UserFactory() cls.person = CentralManagerFactory( "can_access_learningunit", "can_edit_learningunit", user=cls.user ) person_entity = PersonEntityFactory( person=cls.person, entity=EntityVersionFactory().entity, ) cls.academic_year = create_current_academic_year() AcademicCalendarLearningUnitCentralEditionFactory( data_year=cls.academic_year, start_date=datetime.datetime(cls.academic_year.year - 6, 9, 15), end_date=datetime.datetime(cls.academic_year.year + 1, 9, 14) ) cls.luy = LearningUnitYearFullFactory( academic_year=cls.academic_year, internship_subtype=None, acronym="EFAC1000", learning_container_year__container_type=EXTERNAL, learning_container_year__requirement_entity=person_entity.entity, ) cls.data = get_valid_external_learning_unit_form_data(cls.academic_year, cls.person, cls.luy) cls.url = reverse(update_learning_unit, args=[cls.luy.pk])
def setUp(self): self.user = UserFactory() self.user.user_permissions.add(Permission.objects.get(codename="can_access_learningunit")) self.user.user_permissions.add(Permission.objects.get(codename="can_create_learningunit")) self.user.user_permissions.add(Permission.objects.get(codename="can_propose_learningunit")) self.person = PersonFactory(user=self.user) self.client.force_login(self.user) self.academic_year = create_current_academic_year() self.language = LanguageFactory(code='FR') self.data = get_valid_external_learning_unit_form_data(self.academic_year, self.person) self.url = reverse(get_external_learning_unit_creation_form, args=[self.academic_year.pk])
def setUp(self): self.user = UserFactory() self.user.user_permissions.add(Permission.objects.get(codename="can_access_learningunit")) self.user.user_permissions.add(Permission.objects.get(codename="can_create_learningunit")) self.user.user_permissions.add(Permission.objects.get(codename="add_externallearningunityear")) self.person = PersonFactory(user=self.user) self.client.force_login(self.user) starting_year = YEAR_LIMIT_LUE_MODIFICATION self.academic_years = GenerateAcademicYear(starting_year, starting_year + 1).academic_years self.academic_year = self.academic_years[1] self.language = LanguageFactory(code='FR') self.data = get_valid_external_learning_unit_form_data(self.academic_year, self.person) self.url = reverse(get_external_learning_unit_creation_form, args=[self.academic_year.pk])
def setUpTestData(cls): cls.user = UserFactory() cls.person = PersonWithPermissionsFactory( 'can_access_learningunit', 'can_create_learningunit', 'add_externallearningunityear', user=cls.user) starting_year = AcademicYearFactory(year=YEAR_LIMIT_LUE_MODIFICATION) end_year = AcademicYearFactory(year=YEAR_LIMIT_LUE_MODIFICATION + 1) cls.academic_years = GenerateAcademicYear(starting_year, end_year).academic_years cls.academic_year = cls.academic_years[1] cls.language = LanguageFactory(code='FR') cls.data = get_valid_external_learning_unit_form_data( cls.academic_year, cls.person) cls.url = reverse(get_external_learning_unit_creation_form, args=[cls.academic_year.pk])