diff --git a/lms/djangoapps/branding/tests/test_page.py b/lms/djangoapps/branding/tests/test_page.py index 199784da06..ac4357e4f0 100644 --- a/lms/djangoapps/branding/tests/test_page.py +++ b/lms/djangoapps/branding/tests/test_page.py @@ -198,6 +198,52 @@ class IndexPageCourseCardsSortingTests(ModuleStoreTestCase): ) self.factory = RequestFactory() + @patch('student.views.render_to_response', RENDER_MOCK) + @patch('courseware.views.render_to_response', RENDER_MOCK) + @patch.dict('django.conf.settings.FEATURES', {'ENABLE_COURSE_DISCOVERY': False}) + def test_course_discovery_off(self): + """ + Asserts that the Course Discovery UI elements follow the + feature flag settings + """ + response = self.client.get('/') + self.assertEqual(response.status_code, 200) + # assert that the course discovery UI is not present + self.assertNotIn('Search for a course', response.content) + + # check the /courses view + response = self.client.get(reverse('branding.views.courses')) + self.assertEqual(response.status_code, 200) + + # assert that the course discovery UI is not present + self.assertNotIn('Search for a course', response.content) + self.assertNotIn('