'Tests that when a cache TTL is not set, a locked asset will be sent back with a
cache-control header that indicates this asset should not be cached.'

@patch('openedx.core.djangoapps.contentserver.models.CourseAssetCacheTtlConfig.get_cache_ttl')
def test_cache_headers_without_ttl_locked(self, mock_get_cache_ttl):

    mock_get_cache_ttl.return_value = 0
    CourseEnrollment.enroll(self.non_staff_usr, self.course_key)
    self.assertTrue(CourseEnrollment.is_enrolled(self.non_staff_usr, self.course_key))
    self.client.login(username=self.non_staff_usr, password='test')
    resp = self.client.get(self.url_locked)
    self.assertEqual(resp.status_code, 200)
    self.assertNotIn('Expires', resp)
    self.assertEquals('private,    no-cache,    no-store', resp['Cache-Control'])
