示例#1
0
    def test_caching(self):
        # Add fake course enrollment information to the fake data API
        fake_data_api.add_course(self.COURSE_ID, course_modes=['honor', 'verified', 'audit'])

        # Hit the fake data API.
        details = api.get_course_enrollment_details(self.COURSE_ID)

        # Reset the fake data API, should rely on the cache.
        fake_data_api.reset()
        cached_details = api.get_course_enrollment_details(self.COURSE_ID)

        # The data matches
        self.assertEqual(len(details['course_modes']), 3)
        self.assertEqual(details, cached_details)
示例#2
0
 def setUp(self):
     fake_data_api.reset()
     cache.clear()
示例#3
0
 def setUp(self):
     super(EnrollmentTest, self).setUp()
     fake_data_api.reset()
     cache.clear()
示例#4
0
 def setUp(self):
     super(EnrollmentTest, self).setUp()
     fake_data_api.reset()
     cache.clear()
示例#5
0
 def setUp(self):
     fake_data_api.reset()
示例#6
0
 def setUp(self):
     fake_data_api.reset()