Signals in ModuleStoreTestCase/SharedModuleStoreTestCase

14 views
Skip to first unread message

David Ormsbee

unread,
Feb 23, 2017, 11:46:13 AM2/23/17
to edx code
Hi folks,

In order to speed up tests, Django signals emitted by the modulestore (e.g. 'course_published', 'item_deleted') will now be muted by default. If your tests rely on those signals firing, you will now have to explicitly declare them as a class attribute ENABLED_SIGNALS, like the following:

    from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase

    class MyPublishTestCase(ModuleStoreTestCase):
        ENABLED_SIGNALS = ['course_published', 'pre_publish']

I've updated all the tests that were on master as of a couple of hours ago, but you might have to rebase if you're actively working on a test case that relies on signals firing.

For more details, please see: https://github.com/edx/edx-platform/pull/14165 

Thank you!

Dave
Reply all
Reply to author
Forward
0 new messages