def test_can_build_sections_from_section_dicts(self): """ Should be able to load the parsed section listings and create Section model instances from them. """ section_dicts = owlxp.parse_sections(self.test_sections_html) # Create a Section model instance for each section_dict semester = Semester.objects.get(year=2013, term=Semester.SUMMER) sections = [] for s in section_dicts: sections.append(Section.objects.create_from_dict(s, semester=semester)) fixtures_filename = "catalogs/fixtures/%s_full.json" % semester.code utils.dump_catalog_fixtures(fixtures_filename)
def test_fix_course_dicts(self): course_dicts = pickle.load(open("scrapers/dumps/course_dicts", "rb")) owlxp.create_courses(course_dicts) utils.dump_catalog_fixtures("catalogs/fixtures/%s.json" % self.semesters[0].code)