'Check that the student dashboard makes use of course metadata caching.
After creating a course, that course\'s metadata should be cached as a
CourseOverview. The student dashboard should never have to make calls to
the modulestore.
Arguments:
modulestore_type (ModuleStoreEnum.Type): Type of modulestore to create
test course in.
Note to future developers:
If you break this test so that the "check_mongo_calls(0)" fails,
please do NOT change it to "check_mongo_calls(n>1)". Instead, change
your code to not load courses from the module store. This may
involve adding fields to CourseOverview so that loading a full
CourseDescriptor isn\'t necessary.'

@unittest.skipUnless((settings.ROOT_URLCONF == 'lms.urls'), 'Test    only    valid    in    lms')
@ddt.data(ModuleStoreEnum.Type.mongo, ModuleStoreEnum.Type.split)
def test_dashboard_metadata_caching(self, modulestore_type):

    test_course = CourseFactory.create(default_store=modulestore_type, emit_signals=True)
    self.client.login(username='jack', password='test')
    with check_mongo_calls(0):
        CourseEnrollment.enroll(self.user, test_course.id)
    with check_mongo_calls(0):
        response_1 = self.client.get(reverse('dashboard'))
        self.assertEquals(response_1.status_code, 200)
        response_2 = self.client.get(reverse('dashboard'))
        self.assertEquals(response_2.status_code, 200)
