From 6a6ef0fd35e8deb7e672803573551646f252b30d Mon Sep 17 00:00:00 2001 From: Toby Lawrence Date: Fri, 5 Feb 2016 13:43:36 -0500 Subject: [PATCH] Fix some broken tests. --- .../courseware/tests/test_navigation.py | 75 +++++++++---------- .../tests/test_partition_scheme.py | 2 +- 2 files changed, 37 insertions(+), 40 deletions(-) diff --git a/lms/djangoapps/courseware/tests/test_navigation.py b/lms/djangoapps/courseware/tests/test_navigation.py index 2db5f51981..c02aafe0f2 100644 --- a/lms/djangoapps/courseware/tests/test_navigation.py +++ b/lms/djangoapps/courseware/tests/test_navigation.py @@ -17,54 +17,51 @@ from xmodule.modulestore.django import modulestore @attr('shard_1') -class TestNavigation(SharedModuleStoreTestCase, LoginEnrollmentTestCase): +class TestNavigation(ModuleStoreTestCase, LoginEnrollmentTestCase): """ Check that navigation state is saved properly. """ STUDENT_INFO = [('view@test.com', 'foo'), ('view2@test.com', 'foo')] - @classmethod - def setUpClass(cls): - super(TestNavigation, cls).setUpClass() - cls.test_course = CourseFactory.create() - cls.course = CourseFactory.create() - cls.chapter0 = ItemFactory.create(parent=cls.course, - display_name='Overview') - cls.chapter9 = ItemFactory.create(parent=cls.course, - display_name='factory_chapter') - cls.section0 = ItemFactory.create(parent=cls.chapter0, - display_name='Welcome') - cls.section9 = ItemFactory.create(parent=cls.chapter9, - display_name='factory_section') - cls.unit0 = ItemFactory.create(parent=cls.section0, - display_name='New Unit') - - cls.chapterchrome = ItemFactory.create(parent=cls.course, - display_name='Chrome') - cls.chromelesssection = ItemFactory.create(parent=cls.chapterchrome, - display_name='chromeless', - chrome='none') - cls.accordionsection = ItemFactory.create(parent=cls.chapterchrome, - display_name='accordion', - chrome='accordion') - cls.tabssection = ItemFactory.create(parent=cls.chapterchrome, - display_name='tabs', - chrome='tabs') - cls.defaultchromesection = ItemFactory.create( - parent=cls.chapterchrome, - display_name='defaultchrome', - ) - cls.fullchromesection = ItemFactory.create(parent=cls.chapterchrome, - display_name='fullchrome', - chrome='accordion,tabs') - cls.tabtest = ItemFactory.create(parent=cls.chapterchrome, - display_name='progress_tab', - default_tab='progress') - def setUp(self): super(TestNavigation, self).setUp() + self.test_course = CourseFactory.create() + self.course = CourseFactory.create() + self.chapter0 = ItemFactory.create(parent=self.course, + display_name='Overview') + self.chapter9 = ItemFactory.create(parent=self.course, + display_name='factory_chapter') + self.section0 = ItemFactory.create(parent=self.chapter0, + display_name='Welcome') + self.section9 = ItemFactory.create(parent=self.chapter9, + display_name='factory_section') + self.unit0 = ItemFactory.create(parent=self.section0, + display_name='New Unit') + + self.chapterchrome = ItemFactory.create(parent=self.course, + display_name='Chrome') + self.chromelesssection = ItemFactory.create(parent=self.chapterchrome, + display_name='chromeless', + chrome='none') + self.accordionsection = ItemFactory.create(parent=self.chapterchrome, + display_name='accordion', + chrome='accordion') + self.tabssection = ItemFactory.create(parent=self.chapterchrome, + display_name='tabs', + chrome='tabs') + self.defaultchromesection = ItemFactory.create( + parent=self.chapterchrome, + display_name='defaultchrome', + ) + self.fullchromesection = ItemFactory.create(parent=self.chapterchrome, + display_name='fullchrome', + chrome='accordion,tabs') + self.tabtest = ItemFactory.create(parent=self.chapterchrome, + display_name='progress_tab', + default_tab='progress') + # Create student accounts and activate them. for i in range(len(self.STUDENT_INFO)): email, password = self.STUDENT_INFO[i] diff --git a/openedx/core/djangoapps/course_groups/tests/test_partition_scheme.py b/openedx/core/djangoapps/course_groups/tests/test_partition_scheme.py index f53708e314..35d66bb1d9 100644 --- a/openedx/core/djangoapps/course_groups/tests/test_partition_scheme.py +++ b/openedx/core/djangoapps/course_groups/tests/test_partition_scheme.py @@ -393,7 +393,7 @@ class TestMasqueradedGroup(StaffMasqueradeTestCase): group. """ self.course.cohort_config = {'cohorted': True} - self.update_course(self.course, self.test_user.id) + modulestore().update_item(self.course, self.test_user.id) cohort = CohortFactory.create(course_id=self.course.id, users=[self.test_user]) CourseUserGroupPartitionGroup( course_user_group=cohort,