Ejemplo n.º 1
0
def create_school(iped, data):
    school = School(school_id=iped, data_json=STARTER_DATA_JSON)
    for field in data:
        setattr(school, field, data[field])
    school.zip5 = school.zip5[:5]
    school.save()
    _alias = data.get('alias')
    if _alias:
        create_alias(_alias, school)
Ejemplo n.º 2
0
 def test_get_school(self):
     """test grabbing a school by ID"""
     closed_school = School(pk=999999, operating=False)
     closed_school.save()
     test1 = get_school('155317')
     self.assertTrue(test1.pk == 155317)
     test2 = get_school('xxx')
     self.assertTrue(test2 is None)
     test3 = get_school('999999')
     self.assertTrue(test3 is None)
Ejemplo n.º 3
0
def create_school(id, data):
    school = School(school_id=id, data_json=STARTER_DATA_JSON)
    for field in data:
        if field == 'alias':
            ALIAS = data['alias']
        else:
            setattr(school, field, data[field])
    school.zip5 = school.zip5[:5]
    school.save()
    create_alias(ALIAS, school)
Ejemplo n.º 4
0
def create_school(id, data):
    school = School(school_id=id, data_json=STARTER_DATA_JSON)
    for field in data:
        if field == 'alias':
            ALIAS = data['alias']
        else:
            setattr(school, field, data[field])
    school.zip5 = school.zip5[:5]
    school.save()
    alias = create_alias(ALIAS, school)
Ejemplo n.º 5
0
 def test_get_school(self):
     """test grabbing a school by ID"""
     closed_school = School(pk=999999, operating=False)
     closed_school.save()
     test1 = get_school('155317')
     self.assertTrue(test1.pk == 155317)
     test2 = get_school('xxx')
     self.assertTrue(test2 is None)
     test3 = get_school('999999')
     self.assertTrue(test3 is None)