Esempio n. 1
0
class DisciplineActionFactory(APIFactory):
    disciplineActionIdentifier = UniqueIdAttribute(num_chars=20)
    disciplineDate = formatted_date(9, 20)
    disciplines = factory.List([
        factory.Dict(
            dict(disciplineDescriptor=build_descriptor(
                'Discipline', 'Out of School Suspension'))),
    ])
    studentReference = factory.Dict(dict(
        studentUniqueId=111111))  # Default value for scenarios, but not in DB
    actualDisciplineActionLength = 2
    studentDisciplineIncidentAssociations = factory.List([
        factory.Dict(
            dict(
                studentDisciplineIncidentAssociationReference=factory.Dict(
                    dict(
                        incidentIdentifier=None,  # Must be entered by user
                        schoolId=SchoolClient.shared_elementary_school_id(
                        ),  # Prepopulated school
                        studentUniqueId=
                        111111,  # Default value for scenarios, but not in DB
                    )), ), ),
    ])
    responsibilitySchoolReference = factory.Dict(
        dict(schoolId=SchoolClient.shared_elementary_school_id())
    )  # Prepopulated school
class RestraintEventFactory(APIFactory):
    restraintEventIdentifier = UniqueIdAttribute(num_chars=20)
    schoolReference = factory.Dict(
        dict(schoolId=SchoolClient.shared_elementary_school_id()))
    studentReference = factory.Dict(
        dict(studentUniqueId=StudentClient.shared_student_id()))
    eventDate = formatted_date(2, 14)
Esempio n. 3
0
class ChannelFactory(DjangoModelFactory):
    """Factory for a channels.models.Channel object"""

    name = factory.LazyAttributeSequence(channel_name)
    allowed_post_types = DEFAULT_ALLOWED_POST_TYPES
    title = factory.Faker("text", max_nb_chars=50)
    channel_type = FuzzyChoice(VALID_CHANNEL_TYPES)
    about = factory.List(
        [
            factory.Dict({"node": "text", "value": factory.Faker("text")}),
            factory.Dict({"node": "text", "value": factory.Faker("text")}),
            factory.Dict({"node": "text", "value": factory.Faker("text")}),
        ]
    )

    @factory.post_generation
    def create_roles(
        self, create, extracted, **kwargs
    ):  # pylint: disable=unused-argument
        """Create the channel groups and roles after the channel is created"""
        if not create:
            return

        api.create_channel_groups_and_roles(self)

    class Meta:
        model = Channel
Esempio n. 4
0
class SectionFactory(APIFactory):
    educationalEnvironmentDescriptor = build_descriptor(
        "EducationalEnvironment", "Classroom")
    sectionIdentifier = RandomSuffixAttribute("ELA012017RM555")
    availableCredits = 1
    sequenceOfCourse = 1
    classPeriods = factory.List([
        factory.Dict(
            dict(
                classPeriodReference=factory.Dict(
                    dict(classPeriodName=None  # Must be entered by client
                         )), ), ),
    ])
    courseOfferingReference = factory.Dict(
        dict(
            localCourseCode=
            "ELA-01",  # Will need to override this with reference value
            schoolId=SchoolClient.shared_elementary_school_id(),
            schoolYear=2014,
            sessionName=
            "2016-2017 Fall Semester",  # Will need to override this with reference value
        ))
    locationReference = factory.Dict(
        dict(
            schoolId=SchoolClient.shared_elementary_school_id(),
            classroomIdentificationCode=
            "501",  # Will need to override this with reference value
        ))
class StudentAssessmentFactory(APIFactory):
    studentAssessmentIdentifier = UniqueIdAttribute()
    studentReference = factory.Dict(dict(studentUniqueId=StudentClient.shared_student_id()))  # Prepopulated student
    assessmentReference = factory.Dict(
        dict(
            assessmentIdentifier=None,
            namespace='uri://ed-fi.org/Assessment/Assessment.xml'
        )
    )
    administrationDate = RandomDateAttribute()  # Along with studentReference and assessmentReference, this is the PK
    administrationEnvironmentDescriptor = build_descriptor('AdministrationEnvironment', 'Testing Center')
    administrationLanguageDescriptor = build_descriptor('Language', 'eng')
    serialNumber = "0"
    whenAssessedGradeLevelDescriptor = build_descriptor('GradeLevel', 'Sixth grade')
    performanceLevels = factory.List([
        factory.Dict(
            dict(
                assessmentReportingMethodDescriptor=build_descriptor('AssessmentReportingMethod', 'Scale score'),
                performanceLevelDescriptor=build_descriptor('PerformanceLevel', 'Fail'),
                performanceLevelMet=True,
            )
        ),
    ])
    scoreResults = factory.List([
        factory.Dict(
            dict(
                assessmentReportingMethodDescriptor=build_descriptor('AssessmentReportingMethod', 'Scale score'),
                result="25",
                resultDatatypeTypeDescriptor=build_descriptor('ResultDatatypeType', 'Integer'),
            )
        )
    ])
Esempio n. 6
0
class AccountabilityRatingFactory(APIFactory):
    ratingTitle = UniqueIdAttribute()
    educationOrganizationReference = factory.Dict(
        dict(educationOrganizationId=LocalEducationAgencyClient.
             shared_education_organization_id()))
    schoolYearTypeReference = factory.Dict(dict(schoolYear=2014))
    rating = "Recognized"
Esempio n. 7
0
class SourceFactory(factory.Factory):
    class Meta:
        model = Source

    human_name = factory.Faker("name")
    config = factory.Dict({})
    overrides = factory.Dict({})
    macros = factory.List([])
Esempio n. 8
0
class StudentParentAssociationFactory(APIFactory):
    studentReference = factory.Dict(dict(
        studentUniqueId=111111))  # Default value for scenarios, but not in DB
    parentReference = factory.Dict(
        dict(parentUniqueId=None))  # Must be entered by user
    emergencyContactStatus = True
    primaryContactStatus = True
    relationDescriptor = build_descriptor('Relation', 'Father')
Esempio n. 9
0
class EducationOrganizationNetworkAssociationFactory(APIFactory):
    educationOrganizationNetworkReference = factory.Dict(
        dict(educationOrganizationNetworkId=None))  # Must be created
    memberEducationOrganizationReference = factory.Dict(
        dict(educationOrganizationId=LocalEducationAgencyClient.
             shared_education_organization_id()))
    beginDate = formatted_date(1, 1)
    endDate = formatted_date(12, 31)
class PostSecondaryEventFactory(APIFactory):
    eventDate = RandomDateAttribute()
    studentReference = factory.Dict(
        dict(studentUniqueId=StudentClient.shared_student_id()))
    postSecondaryEventCategoryDescriptor = build_descriptor(
        'PostSecondaryEventCategory', 'College Acceptance')
    postSecondaryInstitutionReference = factory.Dict(
        dict(postSecondaryInstitutionId=None))  # Must be entered by user
class CalendarFactory(APIFactory):
    schoolYearTypeReference = factory.Dict({
        'schoolYear': 2014,
    })
    calendarTypeDescriptor = build_descriptor("CalendarType", "IEP")
    calendarCode = RandomSuffixAttribute("107SS111111")
    schoolReference = factory.Dict(
        {"schoolId": SchoolClient.shared_elementary_school_id()})
class GraduationPlanFactory(APIFactory):
    totalRequiredCredits = 28
    graduationPlanTypeDescriptor = build_descriptor('GraduationPlanType', 'Recommended')
    educationOrganizationReference = factory.Dict(
        dict(educationOrganizationId=None),
    )
    graduationSchoolYearTypeReference = factory.Dict(
        dict(schoolYear=2014),
    )
Esempio n. 13
0
class _GirderClientDraftFolderFactory(_GirderClientFolderFactory):
    name = factory.Faker('numerify', text='#' * 6)
    meta = factory.Dict(
        {
            'dandiset': factory.Dict(
                {'name': factory.Faker('sentence'), 'description': factory.Faker('paragraph')}
            )
        }
    )
class StaffEducationOrganizationContactAssociationFactory(APIFactory):
    contactTitle = UniqueIdAttribute(num_chars=75)
    staffReference = factory.Dict(
        dict(staffUniqueId=StaffClient.shared_staff_id())
    )  # Prepopulated staff record
    educationOrganizationReference = factory.Dict(
        dict(educationOrganizationId=SchoolClient.shared_elementary_school_id(
        )))  # Prepopulated school
    electronicMailAddress = '*****@*****.**'
Esempio n. 15
0
class ProviderStatusChangesBody(factory.DictFactory):
    """Expected response from the provider API."""

    version = "0.3.0"
    data = factory.Dict({
        "status_changes":
        factory.List([factory.SubFactory(ProviderStatusChange)])
    })
    links = factory.Dict({"next": None})
Esempio n. 16
0
class StudentCohortAssociationFactory(APIFactory):
    studentReference = factory.Dict(dict(
        studentUniqueId=111111))  # Default value for scenarios, but not in DB
    cohortReference = factory.Dict(
        dict(
            cohortIdentifier='1',  # Default value for scenarios, but not in DB
            educationOrganizationId=SchoolClient.shared_elementary_school_id(
            )  # Prepopulated school
        ))
    beginDate = formatted_date(9, 14)
Esempio n. 17
0
class StudentEducationOrganizationResponsibilityAssociationFactory(APIFactory):
    educationOrganizationReference = factory.Dict(
        dict(educationOrganizationId=SchoolClient.shared_elementary_school_id(
        )))  # Prepopulated school
    studentReference = factory.Dict(
        dict(studentUniqueId=StudentClient.shared_student_id())
    )  # Prepopulated student
    beginDate = RandomDateAttribute()
    responsibilityDescriptor = build_descriptor('Responsibility', 'Graduation')
    endDate = formatted_date(8, 8)
Esempio n. 18
0
class StudentAcademicRecordFactory(APIFactory):
    educationOrganizationReference = factory.Dict(
        dict(educationOrganizationId=SchoolClient.shared_elementary_school_id(
        )))  # Prepopulated school
    schoolYearTypeReference = factory.Dict(dict(schoolYear=current_year()))
    studentReference = factory.Dict(dict(
        studentUniqueId=111111))  # Default value for scenarios, but not in DB
    termDescriptor = build_descriptor('Term', 'Fall Semester')
    cumulativeAttemptedCredits = 0
    cumulativeEarnedCredits = 0
Esempio n. 19
0
class GradingPeriodFactory(APIFactory):
    periodSequence = UniquePrimaryKeyAttribute()
    beginDate = "2014-08-23"
    endDate = "2014-10-04"
    totalInstructionalDays = 29
    schoolReference = factory.Dict(
        dict(schoolId=SchoolClient.shared_elementary_school_id()))
    schoolYearTypeReference = factory.Dict(dict(schoolYear=2014))
    gradingPeriodDescriptor = build_descriptor("GradingPeriod",
                                               "First Six Weeks")
class StaffCohortAssociationFactory(APIFactory):
    beginDate = "2014-09-14"
    staffReference = factory.Dict(
        dict(staffUniqueId=None))  # Must be entered by user
    cohortReference = factory.Dict(
        dict(
            cohortIdentifier=None,
            educationOrganizationId=SchoolClient.shared_elementary_school_id(
            )  # Prepopulated school record
        ))  # Must be provided by caller
class StaffEducationOrganizationAssignmentAssociationFactory(APIFactory):
    staffReference = factory.Dict(
        dict(staffUniqueId=None))  # Must be entered by user
    educationOrganizationReference = factory.Dict(
        dict(educationOrganizationId=SchoolClient.shared_elementary_school_id(
        )))  # Prepopulated school
    staffClassificationDescriptor = build_descriptor('StaffClassification',
                                                     'Teacher')
    positionTitle = '1st Grade teacher'
    beginDate = RandomDateAttribute()
    endDate = formatted_date(1, 3)
class StaffEducationOrganizationEmploymentAssociationFactory(APIFactory):
    employmentStatusDescriptor = build_descriptor('EmploymentStatus',
                                                  'Substitute/temporary')
    staffReference = factory.Dict(
        dict(staffUniqueId=StaffClient.shared_staff_id())
    )  # Prepopulated staff record
    educationOrganizationReference = factory.Dict(
        dict(educationOrganizationId=SchoolClient.shared_elementary_school_id(
        )))  # Prepopulated school
    hireDate = RandomDateAttribute()
    hourlyWage = 20.0
Esempio n. 23
0
class PayrollFactory(APIFactory):
    accountReference = factory.Dict(
        dict(
            accountIdentifier=None,  # Must create an account to refer to
            educationOrganizationId=LocalEducationAgencyClient.shared_education_organization_id(),
            fiscalYear=current_year(),
        )
    )
    staffReference = factory.Dict(dict(staffUniqueId=StaffClient.shared_staff_id()))  # Prepopulated staff
    asOfDate = formatted_date(12, 27)
    amountToDate = 271.83
Esempio n. 24
0
class StudentInterventionAssociationFactory(APIFactory):
    studentReference = factory.Dict(
        dict(studentUniqueId=StudentClient.shared_student_id())
    )  # Prepopulated student
    interventionReference = factory.Dict(
        dict(
            educationOrganizationId=LocalEducationAgencyClient.
            shared_education_organization_id(),
            interventionIdentificationCode=None  # Must be entered by user
        ))
    dosage = 1
Esempio n. 25
0
class EducationOrganizationInterventionPrescriptionAssociationFactory(
        APIFactory):
    educationOrganizationReference = factory.Dict(
        dict(educationOrganizationId=LocalEducationAgencyClient.
             shared_education_organization_id()))
    interventionPrescriptionReference = factory.Dict(
        dict(
            educationOrganizationId=LocalEducationAgencyClient.
            shared_education_organization_id(),
            interventionPrescriptionIdentificationCode=None,  # Must be created
        ))
    beginDate = formatted_date(4, 15)
Esempio n. 26
0
class InterventionStudyFactory(APIFactory):
    interventionStudyIdentificationCode = UniqueIdAttribute(num_chars=60)
    educationOrganizationReference = factory.Dict(dict(educationOrganizationId=LocalEducationAgencyClient.shared_education_organization_id()))
    interventionPrescriptionReference = factory.Dict(
        dict(
            educationOrganizationId=LocalEducationAgencyClient.shared_education_organization_id(),
            interventionPrescriptionIdentificationCode=None,  # Must be created by client
        )
    )
    deliveryMethodDescriptor = build_descriptor('DeliveryMethod', 'Whole Class')
    interventionClassDescriptor = build_descriptor('InterventionClass', 'Practice')
    participants = 25
Esempio n. 27
0
class StudentDisciplineIncidentAssociationFactory(APIFactory):
    disciplineIncidentReference = factory.Dict(
        dict(
            incidentIdentifier=None,  # Must be entered by user
            schoolId=SchoolClient.shared_elementary_school_id(
            ),  # Prepopulated school
        ), )
    studentReference = factory.Dict(
        dict(studentUniqueId=111111
             ),  # Default value for scenarios, but not in DB
    )
    studentParticipationCodeDescriptor = build_descriptor(
        'StudentParticipationCode', 'Perpetrator')
Esempio n. 28
0
class RecordMetadataFactory(BaseFactory):
    class Meta:
        model = RecordMetadata

    json = factory.Dict(
        {
            "$schema": "http://localhost:5000/schemas/record/hep.json",
            "titles": factory.List([factory.Dict({"title": faker.sentence()})]),
            "document_type": ["article"],
            "_collections": ["Literature"],
            "control_number": faker.control_number(),
        }
    )
Esempio n. 29
0
class StudentInterventionAttendanceEventFactory(APIFactory):
    studentReference = factory.Dict(
        dict(studentUniqueId=StudentClient.shared_student_id())
    )  # Prepopulated student
    interventionReference = factory.Dict(
        dict(
            educationOrganizationId=LocalEducationAgencyClient.
            shared_education_organization_id(),
            interventionIdentificationCode=None  # Must be entered by user
        ))
    eventDate = RandomDateAttribute()
    attendanceEventCategoryDescriptor = build_descriptor(
        'AttendanceEventCategory', 'In Attendance')
    interventionDuration = 2
class StaffProgramAssociationFactory(APIFactory):
    beginDate = RandomDateAttribute()
    staffReference = factory.Dict(
        dict(staffUniqueId=StaffClient.shared_staff_id())
    )  # Prepopulated staff record
    programReference = factory.Dict(
        dict(
            educationOrganizationId=LocalEducationAgencyClient.
            shared_education_organization_id(),
            programName=ProgramClient.shared_program_name(),
            programTypeDescriptor=build_descriptor(
                'ProgramType', ProgramClient.shared_program_name()),
        ))  # Prepopulated program
    studentRecordAccess = True