feat!: remove all access to Old Mongo courses

Change has_access to deny 'load' support for Old Mongo courses.

This is in service of dropping support for these ancient
courses and removing legacy code that they rely on.

DEPR-58
This commit is contained in:
Michael Terry
2022-04-04 10:37:09 -04:00
parent 4ab3b7d08b
commit fc8601de01
5 changed files with 59 additions and 0 deletions

View File

@@ -527,6 +527,25 @@ class TestCourseHomePageAccess(CourseHomePageTestCase):
)
self.assertRedirects(response, expected_url)
def test_old_mongo_access_error(self):
"""
Ensure that a user accessing an Old Mongo course sees a redirect to
the student dashboard, not a 404.
"""
course = CourseFactory.create(default_store=ModuleStoreEnum.Type.mongo)
user = UserFactory(password=self.TEST_PASSWORD)
self.client.login(username=user.username, password=self.TEST_PASSWORD)
response = self.client.get(course_home_url(course))
expected_params = QueryDict(mutable=True)
expected_params['access_response_error'] = f'{course.display_name_with_default} is no longer available.'
expected_url = '{url}?{params}'.format(
url=reverse('dashboard'),
params=expected_params.urlencode(),
)
self.assertRedirects(response, expected_url)
@mock.patch.dict(settings.FEATURES, {'DISABLE_START_DATES': False})
def test_expiration_banner_with_expired_upgrade_deadline(self):
"""