From bdf08fc7e2d5a710969c813ae127ac4b2073ddea Mon Sep 17 00:00:00 2001 From: Calen Pennington Date: Thu, 2 Jun 2016 14:45:41 -0400 Subject: [PATCH] Separate CourseInfo tests into a separate ModulestoreTestCase --- .../courseware/tests/test_course_info.py | 33 +++++++++++++++++-- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/lms/djangoapps/courseware/tests/test_course_info.py b/lms/djangoapps/courseware/tests/test_course_info.py index e76261b93a..b02dd52538 100644 --- a/lms/djangoapps/courseware/tests/test_course_info.py +++ b/lms/djangoapps/courseware/tests/test_course_info.py @@ -46,9 +46,6 @@ class CourseInfoTestCase(LoginEnrollmentTestCase, SharedModuleStoreTestCase): data="OOGIE BLOOGIE", display_name="updates" ) - def setUp(self): - super(CourseInfoTestCase, self).setUp() - def test_logged_in_unenrolled(self): self.setup_user() url = reverse('info', args=[self.course.id.to_deprecated_string()]) @@ -101,6 +98,21 @@ class CourseInfoTestCase(LoginEnrollmentTestCase, SharedModuleStoreTestCase): response = self.client.get(url) self.assertEqual(response.status_code, 404) + +@attr('shard_1') +class CourseInfoLastAccessedTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase): + """ + Tests of the CourseInfo last accessed link. + """ + + def setUp(self): + super(CourseInfoLastAccessedTestCase, self).setUp() + self.course = CourseFactory.create() + self.page = ItemFactory.create( + category="course_info", parent_location=self.course.location, + data="OOGIE BLOOGIE", display_name="updates" + ) + def test_last_accessed_courseware_not_shown(self): """ Test that the last accessed courseware link is not shown if there @@ -134,6 +146,21 @@ class CourseInfoTestCase(LoginEnrollmentTestCase, SharedModuleStoreTestCase): content = pq(info_page_response.content) self.assertEqual(content('.page-header-secondary .last-accessed-link').attr('href'), section_url) + +@attr('shard_1') +class CourseInfoTitleTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase): + """ + Tests of the CourseInfo page title. + """ + + def setUp(self): + super(CourseInfoTitleTestCase, self).setUp() + self.course = CourseFactory.create() + self.page = ItemFactory.create( + category="course_info", parent_location=self.course.location, + data="OOGIE BLOOGIE", display_name="updates" + ) + def test_info_title(self): """ Test the info page on a course without any display_* settings against