Exemplo n.º 1
0
 def test_ics(self):
     # FIXME: remove http request dependency
     semester = SemesterFactory.create(year=2012, month=9)
     sections = SectionFactory.create_batch(3, semester=semester)
     crns = [str(s.crn) for s in sections]
     response = self.get('ics',
                         get='?crn=' + '&crn='.join(crns),
                         status_code=200)
Exemplo n.º 2
0
 def test_get_sections_by_course(self):
     c1 = CourseFactory.create()
     sec1, sec2 = SectionFactory.create_batch(2, course=c1)
     s1 = SectionPeriodFactory.create(section=sec1)
     s2 = SectionPeriodFactory.create(section=sec2)
     s3, s4 = SectionPeriodFactory.create_batch(2)
     json = self.json_get(
         'v4:sections', get='?course_id=%d' % c1.id, status_code=200)
     self.assertEqual(json, {
         u"version": 4,
         u"success": True,
         u"result": [
             self.to_dict(s1),
             self.to_dict(s2),
         ]
     })
Exemplo n.º 3
0
 def test_get_sections_by_course(self):
     c1 = CourseFactory.create()
     sec1, sec2 = SectionFactory.create_batch(2, course=c1)
     s1 = SectionPeriodFactory.create(section=sec1)
     s2 = SectionPeriodFactory.create(section=sec2)
     s3, s4 = SectionPeriodFactory.create_batch(2)
     json = self.json_get(
         'v4:sections', get='?course_id=%d' % c1.id, status_code=200)
     self.assertEqual(json, {
         u"version": 4,
         u"success": True,
         u"result": [
             self.to_dict(s1),
             self.to_dict(s2),
         ]
     })
Exemplo n.º 4
0
Arquivo: tests.py Projeto: mdznr/YACS
 def test_ics(self):
     # FIXME: remove http request dependency
     semester = SemesterFactory.create(year=2012, month=9)
     sections = SectionFactory.create_batch(3, semester=semester)
     crns = [str(s.crn) for s in sections]
     response = self.get('ics', get='?crn=' + '&crn='.join(crns), status_code=200)