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)
def setUp(self): fake_data_api.reset() cache.clear()
def setUp(self): super(EnrollmentTest, self).setUp() fake_data_api.reset() cache.clear()
def setUp(self): fake_data_api.reset()