Induce a base class for schedule email management command tests

This commit is contained in:
Calen Pennington
2017-10-25 10:05:33 -04:00
committed by Nimisha Asthagiri
parent 8435e7b571
commit 5be19e22c2
3 changed files with 8 additions and 2 deletions

View File

@@ -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']

View File

@@ -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']

View File

@@ -0,0 +1,4 @@
from openedx.core.djangolib.testing.utils import CacheIsolationTestCase, FilteredQueryCountMixin
class ScheduleBaseEmailTestBase(FilteredQueryCountMixin, CacheIsolationTestCase):
pass