diff --git a/openedx/core/djangoapps/schedules/management/commands/tests/test_send_recurring_nudge.py b/openedx/core/djangoapps/schedules/management/commands/tests/test_send_recurring_nudge.py index aadaf75916..254e4d46ab 100644 --- a/openedx/core/djangoapps/schedules/management/commands/tests/test_send_recurring_nudge.py +++ b/openedx/core/djangoapps/schedules/management/commands/tests/test_send_recurring_nudge.py @@ -21,6 +21,7 @@ from courseware.models import DynamicUpgradeDeadlineConfiguration from openedx.core.djangoapps.content.course_overviews.tests.factories import CourseOverviewFactory from openedx.core.djangoapps.schedules import resolvers, tasks from openedx.core.djangoapps.schedules.management.commands import send_recurring_nudge as nudge +from openedx.core.djangoapps.schedules.management.commands.tests.tools import ScheduleBaseEmailTestBase from openedx.core.djangoapps.schedules.tests.factories import ScheduleConfigFactory, ScheduleFactory from openedx.core.djangoapps.site_configuration.tests.factories import SiteConfigurationFactory, SiteFactory from openedx.core.djangoapps.waffle_utils.testutils import WAFFLE_TABLES @@ -45,7 +46,7 @@ NUM_COURSE_MODES_QUERIES = 1 @skip_unless_lms @skipUnless('openedx.core.djangoapps.schedules.apps.SchedulesConfig' in settings.INSTALLED_APPS, "Can't test schedules if the app isn't installed") -class TestSendRecurringNudge(FilteredQueryCountMixin, CacheIsolationTestCase): +class TestSendRecurringNudge(ScheduleBaseEmailTestBase): # pylint: disable=protected-access ENABLED_CACHES = ['default'] diff --git a/openedx/core/djangoapps/schedules/management/commands/tests/test_send_upgrade_reminder.py b/openedx/core/djangoapps/schedules/management/commands/tests/test_send_upgrade_reminder.py index 6fb9963c84..ebd496abf9 100644 --- a/openedx/core/djangoapps/schedules/management/commands/tests/test_send_upgrade_reminder.py +++ b/openedx/core/djangoapps/schedules/management/commands/tests/test_send_upgrade_reminder.py @@ -22,6 +22,7 @@ from courseware.models import DynamicUpgradeDeadlineConfiguration from openedx.core.djangoapps.content.course_overviews.models import CourseOverview from openedx.core.djangoapps.schedules import resolvers, tasks from openedx.core.djangoapps.schedules.management.commands import send_upgrade_reminder as reminder +from openedx.core.djangoapps.schedules.management.commands.tests.tools import ScheduleBaseEmailTestBase from openedx.core.djangoapps.schedules.tests.factories import ScheduleConfigFactory, ScheduleFactory from openedx.core.djangoapps.site_configuration.tests.factories import SiteConfigurationFactory, SiteFactory from openedx.core.djangoapps.waffle_utils.testutils import WAFFLE_TABLES @@ -59,7 +60,7 @@ LOG = logging.getLogger(__name__) @skipUnless('openedx.core.djangoapps.schedules.apps.SchedulesConfig' in settings.INSTALLED_APPS, "Can't test schedules if the app isn't installed") @freeze_time('2017-08-01 00:00:00', tz_offset=0, tick=True) -class TestUpgradeReminder(SharedModuleStoreTestCase): +class TestUpgradeReminder(ScheduleBaseEmailTestBase, SharedModuleStoreTestCase): ENABLED_CACHES = ['default'] diff --git a/openedx/core/djangoapps/schedules/management/commands/tests/tools.py b/openedx/core/djangoapps/schedules/management/commands/tests/tools.py new file mode 100644 index 0000000000..e83526df76 --- /dev/null +++ b/openedx/core/djangoapps/schedules/management/commands/tests/tools.py @@ -0,0 +1,4 @@ +from openedx.core.djangolib.testing.utils import CacheIsolationTestCase, FilteredQueryCountMixin + +class ScheduleBaseEmailTestBase(FilteredQueryCountMixin, CacheIsolationTestCase): + pass