def run_course_scenarios(self): self.run_scenario('courseTitle', "Algebra II") self.run_scenario('levelCharacteristics', [{'courseLevelCharacteristicDescriptor': build_descriptor('courseLevelCharacteristic', 'Basic')}], academicSubjectDescriptor=build_descriptor('AcademicSubject', 'Fine and Performing Arts'), courseTitle='Art, Grade 1', courseCode=RandomSuffixAttribute('ART 01'))
def run_association_scenarios(self): self.run_scenario('academicSubjects', [{ 'academicSubjectDescriptor': build_descriptor('AcademicSubject', 'Social Studies') }]) self.run_scenario('gradeLevels', [{ 'gradeLevelDescriptor': build_descriptor('GradeLevel', 'Tenth grade') }], schoolId=SchoolClient.shared_high_school_id())
def run_cohort_scenarios(self): self.run_scenario('cohortTypeDescriptor', build_descriptor("CohortType", "Field Trip")) self.run_scenario( 'cohortTypeDescriptor', build_descriptor("CohortType", "Extracurricular Activity"), cohortIdentifier=RandomSuffixAttribute("2"), educationOrganizationReference__educationOrganizationId=SchoolClient .shared_high_school_id(), cohortDescription="Cohort 2 Description")
def run_discipline_incident_scenarios(self): self.run_scenario('reporterName', "Villa, Mark") self.run_scenario( 'incidentLocationDescriptor', build_descriptor('IncidentLocation', 'Classroom'), schoolId=SchoolClient.shared_high_school_id( ), # Prepopulated school behaviors__0__behaviorDescriptor=build_descriptor( 'Behavior', 'State Offense'), incidentLocationDescriptor=build_descriptor( 'IncidentLocation', 'Library/media center'), reporterName="Moran, Patricia")
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
def run_discipline_action_scenarios(self): self.run_scenario('disciplines', [{ 'disciplineDescriptor': build_descriptor('Discipline', 'In School Suspension') }]) self.run_scenario( 'disciplines', [{ 'disciplineDescriptor': build_descriptor('Discipline', 'Community Service') }], schoolId=SchoolClient.shared_high_school_id(), disciplines__0__disciplineDescriptor=build_descriptor( 'Discipline', 'In School Suspension'), actualDisciplineActionLength=5)
class LearningStandardFactory(APIFactory): learningStandardId = UniqueIdAttribute() academicSubjects = factory.List([ factory.Dict( dict(academicSubjectDescriptor=build_descriptor('AcademicSubject', 'Mathematics')) ) ]) courseTitle = "Advanced Math for students v4.4" description = "Unit 1 Advanced Math for students v4.4" namespace = 'uri://ed-fi.org/LearningStandard/LearningStandard.xml' gradeLevels = factory.List([ factory.Dict( dict(gradeLevelDescriptor=build_descriptor('GradeLevel', 'Tenth grade')) ), ])
class CompetencyObjectiveFactory(APIFactory): educationOrganizationReference = factory.Dict( dict(educationOrganizationId=LocalEducationAgencyClient. shared_education_organization_id())) objective = UniqueIdAttribute(num_chars=60) objectiveGradeLevelDescriptor = build_descriptor('GradeLevel', 'Tenth grade')
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
def run_graduation_plan_scenarios(self): self.run_scenario('totalRequiredCredits', 30) self.run_scenario('totalRequiredCredits', 24, totalRequiredCredits=26, graduationPlanTypeDescriptor=build_descriptor( 'GraduationPlanType', 'Minimum'))
class AssessmentFactory(APIFactory): assessmentIdentifier = UniqueIdAttribute() academicSubjects = factory.List([ factory.Dict( dict( academicSubjectDescriptor=build_descriptor('AcademicSubject', 'English') ) ) ]) assessedGradeLevels = factory.List([ factory.Dict( dict( gradeLevelDescriptor=build_descriptor('GradeLevel', 'Twelfth grade') ) ) ]) assessmentTitle = RandomSuffixAttribute("AP - English") assessmentVersion = 2017 maxRawScore = 25 namespace = 'uri://ed-fi.org/Assessment/Assessment.xml' identificationCodes = factory.List([ factory.Dict( dict( assessmentIdentificationSystemDescriptor=build_descriptor( 'AssessmentIdentificationSystem', 'Test Contractor'), identificationCode="AP English", ) ), ]) performanceLevels = factory.List([ factory.Dict( dict( assessmentReportingMethodDescriptor=build_descriptor('AssessmentReportingMethod', 'Scale score'), performanceLevelDescriptor=build_descriptor('PerformanceLevel', 'Pass'), maximumScore="25", minimumScore="12", ) ), factory.Dict( dict( assessmentReportingMethodDescriptor=build_descriptor('AssessmentReportingMethod', 'Scale score'), performanceLevelDescriptor=build_descriptor('PerformanceLevel', 'Fail'), maximumScore="11", minimumScore="0", ) ), ]) scores = factory.List([ factory.Dict( dict( assessmentReportingMethodDescriptor=build_descriptor('AssessmentReportingMethod', 'Scale score'), resultDatatypeType="Integer", maximumScore="25", minimumScore="0", ) ), ])
def run_association_scenarios(self): self.run_scenario( 'classroomPositionDescriptor', build_descriptor('ClassroomPosition', 'Assistant Teacher')) self.run_scenario('endDate', formatted_date(9, 1), schoolId=SchoolClient.shared_high_school_id(), courseCode="ALG-2")
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 CredentialFactory(APIFactory): credentialIdentifier = UniqueIdAttribute(num_chars=60) stateOfIssueStateAbbreviationDescriptor = build_descriptor( 'StateAbbreviation', 'TX') credentialFieldDescriptor = build_descriptor('CredentialField', 'Mathematics') credentialTypeDescriptor = build_descriptor('CredentialType', 'Registration') teachingCredentialDescriptor = build_descriptor('TeachingCredential', 'Paraprofessional') issuanceDate = formatted_date(7, 4) gradeLevels = factory.List([ factory.Dict( dict(gradeLevelDescriptor=build_descriptor('GradeLevel', 'Sixth grade')), ), ]) namespace = "uri://ed-fi.org"
def run_grading_period_scenarios(self): high_school_id = SchoolClient.shared_high_school_id() self.run_scenario('endDate', "2014-10-05") self.run_scenario(beginDate="2014-10-06", endDate="2014-12-15", totalInstructionalDays=30, gradingPeriodDescriptor=build_descriptor( "GradingPeriod", "Second Six Weeks")) self.run_scenario('endDate', "2014-10-05", schoolReference__schoolId=high_school_id) self.run_scenario(schoolReference__schoolId=high_school_id, beginDate="2014-10-06", endDate="2014-12-15", totalInstructionalDays=30, gradingPeriodDescriptor=build_descriptor( "GradingPeriod", "Second Six Weeks"))
class CommunityProviderLicenseFactory(APIFactory): licenseIdentifier = UniqueIdAttribute(num_chars=20) communityProviderReference = factory.Dict( dict(communityProviderId=None)) # Need to create as dependency licensingOrganization = "USDOE" licenseTypeDescriptor = build_descriptor('LicenseType', 'School Age Program') licenseEffectiveDate = formatted_date(11, 24)
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'), ) ) ])
class DisciplineIncidentFactory(APIFactory): incidentDate = formatted_date(9, 25) incidentIdentifier = UniqueIdAttribute(num_chars=20) schoolReference = factory.Dict( dict(schoolId=SchoolClient.shared_elementary_school_id()) ) # Prepopulated school staffReference = factory.Dict( dict(staffUniqueId=None)) # Must be entered by user behaviors = factory.List([ factory.Dict( dict(behaviorDescriptor=build_descriptor( 'Behavior', 'School Code of Conduct')), ) ]) incidentLocationDescriptor = build_descriptor('IncidentLocation', 'School Bus') reporterDescriptionDescriptor = build_descriptor('ReporterDescription', 'Staff') reporterName = "Villa, Mike"
def run_calendar_scenarios(self): self.run_scenario('calendarTypeDescriptor', build_descriptor('CalendarType', 'Student Specific')) self.run_scenario( 'gradeLevels', build_descriptor_dicts('GradeLevel', ['Ninth grade', 'Tenth grade']), calendarCode=RandomSuffixAttribute("IEP001"), schoolReference__schoolId=SchoolClient.shared_high_school_id(), gradeLevels=build_descriptor_dicts('GradeLevel', ['Ninth grade']))
class ParentPipecleanTest(EdFiPipecleanTestBase): update_attribute_name = 'parentOtherNames' update_attribute_value = [{ 'firstName': "Lexi", 'lastSurname': "Johnson", 'otherNameTypeDescriptor': build_descriptor('OtherNameType', 'Nickname'), }]
class CommunityProviderFactory(APIFactory): communityProviderId = UniquePrimaryKeyAttribute() communityOrganizationReference = factory.Dict( dict(communityOrganizationId=None)) # Need to create as dependency nameOfInstitution = "Provider for the Arts" providerProfitabilityDescriptor = build_descriptor('ProviderProfitability', 'Nonprofit') providerStatusDescriptor = build_descriptor('ProviderStatus', 'Active') providerCategoryDescriptor = build_descriptor('ProviderCategory', 'Center-EC') addresses = factory.List([ factory.SubFactory(AddressFactory), ]) categories = ListOfDescriptors('EducationOrganizationCategory', ['School']) educationOrganizationCodes = factory.LazyAttribute( lambda o: build_descriptor_dicts( 'EducationOrganizationIdentificationSystem', [('Other', { 'identificationCode': o.communityProviderId })]))
class AssessmentItemFactory(APIFactory): assessmentReference = factory.Dict( dict( assessmentIdentifier=None, namespace='uri://ed-fi.org/Assessment/Assessment.xml' ) ) identificationCode = UniqueIdAttribute() assessmentItemCategoryDescriptor = build_descriptor('AssessmentItemCategory', 'List Question') correctResponse = 'A' maxRawScore = 1
def run_parent_scenarios(self): update_attribute_value = [{ 'firstName': "Lexi", 'lastSurname': "Johnson", 'otherNameTypeDescriptor': build_descriptor('OtherNameType', 'Nickname') }] self.run_scenario('parentOtherNames', update_attribute_value) self.run_scenario( 'parentOtherNames', update_attribute_value, firstName="Alexis", lastSurname="Johnson", personalTitlePrefix="Mrs.", sexDescriptor=build_descriptor('Sex', 'Female'), addresses__0__addressTypeDescriptor=build_descriptor( 'AddressType', 'Home'), addresses__0__streetNumberName="456 Cedar Street", electronicMails__0__electronicMailAddress="*****@*****.**" )
def run_staff_scenarios(self): self.run_scenario('highlyQualifiedTeacher', False) self.run_scenario( 'hispanicLatinoEthnicity', False, firstName="Jane", middleName="Marcy", lastSurname="Smith", birthDate="1973-07-20", highestCompletedLevelOfEducationDescriptor=build_descriptor( 'LevelOfEducation', 'Doctorate'), personalTitlePrefix="Mrs", sexDescriptor=build_descriptor('Sex', 'Female'), electronicMails=[ dict( electronicMailAddress="*****@*****.**", electronicMailTypeDescriptor=build_descriptor( 'ElectronicMailType', 'Work'), ) ], races__0__raceDescriptor=build_descriptor( 'Race', 'Black - African American'))
class LearningObjectiveFactory(APIFactory): academicSubjects = factory.List([ factory.Dict( dict( academicSubjectDescriptor=build_descriptor('AcademicSubject', 'Mathematics'), namespace='uri://ed-fi.org/' ) ) ]) objective = RandomSuffixAttribute("Number Operations and Concepts") gradeLevels = factory.List([ factory.Dict( dict( gradeLevelDescriptor=build_descriptor('GradeLevel', 'Sixth grade') ) ) ]) description = ( "The student will demonstrate the ability to utilize numbers to perform" " operations with complex concepts." ) learningObjectiveId = UniqueIdAttribute() namespace = 'uri://ed-fi.org'
class InterventionFactory(APIFactory): interventionIdentificationCode = UniqueIdAttribute(num_chars=60) educationOrganizationReference = factory.Dict(dict(educationOrganizationId=LocalEducationAgencyClient.shared_education_organization_id())) interventionPrescriptions = factory.List([ factory.Dict( dict( interventionPrescriptionReference=factory.Dict( dict( interventionPrescriptionIdentificationCode=None, # Must be created by client educationOrganizationId=LocalEducationAgencyClient.shared_education_organization_id(), ), ), ) ), ]) deliveryMethodDescriptor = build_descriptor('DeliveryMethod', 'Whole Class') interventionClassDescriptor = build_descriptor('InterventionClass', 'Practice') appropriateGradeLevels = factory.List([ factory.Dict( dict(gradeLevelDescriptor=build_descriptor('GradeLevel', 'Ninth grade')) ) ]) beginDate = formatted_date(8, 23)
class GradeFactory(APIFactory): gradeTypeDescriptor = build_descriptor('GradeType', 'Grading Period') letterGradeEarned = "B" numericGradeEarned = 80 gradingPeriodReference = factory.Dict( dict( schoolId=SchoolClient.shared_elementary_school_id(), gradingPeriodDescriptor=build_descriptor('GradingPeriod', 'First Six Weeks'), periodSequence=1, schoolYear=current_year(), ) ) studentSectionAssociationReference = factory.Dict( dict( beginDate=formatted_date(8, 23), localCourseCode='ELA-01', schoolId=SchoolClient.shared_elementary_school_id(), schoolYear=current_year(), studentUniqueId=1111111, # Default value for scenarios, but not in DB sessionName="2016-2017 Fall Semester", sectionIdentifier="ELA012017RM555", ) )
class AccountFactory(APIFactory): accountIdentifier = UniqueIdAttribute() educationOrganizationReference = factory.Dict(dict(educationOrganizationId=LocalEducationAgencyClient.shared_education_organization_id())) accountCodes = factory.List([ factory.Dict({ # Values for a prepopulated account, but don't rely on this existing 'accountCodeReference': dict( accountCodeNumber="1000", educationOrganizationId=LocalEducationAgencyClient.shared_education_organization_id(), accountClassificationDescriptor=build_descriptor('AccountClassification', 'Function'), fiscalYear=current_year(), ) }), ]) fiscalYear = current_year()
class EducationOrganizationNetworkFactory(APIFactory): educationOrganizationNetworkId = UniquePrimaryKeyAttribute() nameOfInstitution = "Schools United Texas" networkPurposeDescriptor = build_descriptor('NetworkPurpose', 'Shared Services') addresses = factory.List([ factory.SubFactory(AddressFactory), ]) categories = ListOfDescriptors('EducationOrganizationCategory', ['School']) educationOrganizationCodes = factory.LazyAttribute( lambda o: build_descriptor_dicts( 'EducationOrganizationIdentificationSystem', [('SEA', { 'identificationCode': o.educationOrganizationNetworkId })]))
class ReportCardFactory(APIFactory): educationOrganizationReference = factory.Dict( dict(educationOrganizationId=LocalEducationAgencyClient. shared_education_organization_id())) studentReference = factory.Dict( dict(studentUniqueId=StudentClient.shared_student_id()) ) # Prepopulated student gradingPeriodReference = factory.Dict( dict( periodSequence=None, # Must be created schoolId=SchoolClient.shared_elementary_school_id(), schoolYear=2014, gradingPeriodDescriptor=build_descriptor("GradingPeriod", "First Six Weeks"), )) gpaGivenGradingPeriod = 3.14