Commit 9a8ecc65 by Clinton Blackburn Committed by Adam Palay

Removed invalid kwarg

parent cb9c89e1
...@@ -11,6 +11,7 @@ from django.conf import settings ...@@ -11,6 +11,7 @@ from django.conf import settings
import ddt import ddt
import copy import copy
from openedx.core.djangoapps.content.course_structures.tests import SignalDisconnectTestMixin
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore import ModuleStoreEnum from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.django import modulestore from xmodule.modulestore.django import modulestore
...@@ -28,7 +29,7 @@ TEST_DATA_DIR = settings.COMMON_TEST_DATA_ROOT ...@@ -28,7 +29,7 @@ TEST_DATA_DIR = settings.COMMON_TEST_DATA_ROOT
@ddt.ddt @ddt.ddt
@override_settings(CONTENTSTORE=TEST_DATA_CONTENTSTORE) @override_settings(CONTENTSTORE=TEST_DATA_CONTENTSTORE)
class ContentStoreImportTest(ModuleStoreTestCase): class ContentStoreImportTest(SignalDisconnectTestMixin, ModuleStoreTestCase):
""" """
Tests that rely on the toy and test_import_course courses. Tests that rely on the toy and test_import_course courses.
NOTE: refactor using CourseFactory so they do not. NOTE: refactor using CourseFactory so they do not.
......
...@@ -19,6 +19,7 @@ from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase ...@@ -19,6 +19,7 @@ from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
from mock import Mock from mock import Mock
from opaque_keys.edx.locator import CourseKey, LibraryLocator from opaque_keys.edx.locator import CourseKey, LibraryLocator
from openedx.core.djangoapps.content.course_structures.tests import SignalDisconnectTestMixin
class LibraryTestCase(ModuleStoreTestCase): class LibraryTestCase(ModuleStoreTestCase):
...@@ -457,7 +458,7 @@ class TestLibraries(LibraryTestCase): ...@@ -457,7 +458,7 @@ class TestLibraries(LibraryTestCase):
@ddt.ddt @ddt.ddt
class TestLibraryAccess(LibraryTestCase): class TestLibraryAccess(SignalDisconnectTestMixin, LibraryTestCase):
""" """
Test Roles and Permissions related to Content Libraries Test Roles and Permissions related to Content Libraries
""" """
......
...@@ -10,4 +10,4 @@ def listen_for_course_publish(sender, course_key, **kwargs): # pylint: disable= ...@@ -10,4 +10,4 @@ def listen_for_course_publish(sender, course_key, **kwargs): # pylint: disable=
# Note: The countdown=0 kwarg is set to to ensure the method below does not attempt to access the course # Note: The countdown=0 kwarg is set to to ensure the method below does not attempt to access the course
# before the signal emitter has finished all operations. This is also necessary to ensure all tests pass. # before the signal emitter has finished all operations. This is also necessary to ensure all tests pass.
update_course_structure.delay(unicode(course_key), countdown=0) update_course_structure.apply_async([unicode(course_key)], countdown=0)
import json import json
from xmodule.modulestore.django import SignalHandler
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
from openedx.core.djangoapps.content.course_structures.models import CourseStructure from openedx.core.djangoapps.content.course_structures.models import CourseStructure
from openedx.core.djangoapps.content.course_structures.signals import listen_for_course_publish
from openedx.core.djangoapps.content.course_structures.tasks import _generate_course_structure, update_course_structure from openedx.core.djangoapps.content.course_structures.tasks import _generate_course_structure, update_course_structure
class SignalDisconnectTestMixin(object):
"""
Mixin for tests to disable calls to signals.listen_for_course_publish when the course_published signal is fired.
"""
def setUp(self):
super(SignalDisconnectTestMixin, self).setUp()
SignalHandler.course_published.disconnect(listen_for_course_publish)
class CourseStructureTaskTests(ModuleStoreTestCase): class CourseStructureTaskTests(ModuleStoreTestCase):
def setUp(self, **kwargs): def setUp(self, **kwargs):
super(CourseStructureTaskTests, self).setUp() super(CourseStructureTaskTests, self).setUp()
......
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