Commit 484aa116 by Jonathan Piacenti

Fix gradebook entry generation test that affected global state.

parent a45aa8e3
...@@ -18,12 +18,8 @@ from student.tests.factories import UserFactory, CourseEnrollmentFactory ...@@ -18,12 +18,8 @@ from student.tests.factories import UserFactory, CourseEnrollmentFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase, mixed_store_config from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase, mixed_store_config
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
MODULESTORE_CONFIG = mixed_store_config(settings.COMMON_TEST_DATA_ROOT, {}, include_xml=False)
@patch.dict(settings.FEATURES, {'SIGNAL_ON_SCORE_CHANGED': True}) @patch.dict(settings.FEATURES, {'SIGNAL_ON_SCORE_CHANGED': True})
@override_settings(MODULESTORE=MODULESTORE_CONFIG)
@patch.dict("django.conf.settings.FEATURES", {'SIGNAL_ON_SCORE_CHANGED': False})
class GenerateGradebookEntriesTests(ModuleStoreTestCase): class GenerateGradebookEntriesTests(ModuleStoreTestCase):
""" """
Test suite for grade generation script Test suite for grade generation script
...@@ -32,7 +28,7 @@ class GenerateGradebookEntriesTests(ModuleStoreTestCase): ...@@ -32,7 +28,7 @@ class GenerateGradebookEntriesTests(ModuleStoreTestCase):
def setUp(self): def setUp(self):
super(GenerateGradebookEntriesTests, self).setUp() super(GenerateGradebookEntriesTests, self).setUp()
# Turn off the signalling mechanism temporarily # Turn off the signalling mechanism temporarily
settings._wrapped.default_settings.FEATURES['SIGNAL_ON_SCORE_CHANGED'] = False with patch.dict(settings.FEATURES, {'SIGNAL_ON_SCORE_CHANGED': False}):
# Create a couple courses to work with # Create a couple courses to work with
self.course = CourseFactory.create( self.course = CourseFactory.create(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment