Add a TestCase mixin for enabling caches in tests
By default, disable all caching in tests, to preserve test independence. In order to enable caching, inherit from CacheSetupMixin, and specify which cache configuration is needed. [EV-32]
This commit is contained in:
@@ -36,6 +36,7 @@ class CourseInfoTestCase(LoginEnrollmentTestCase, SharedModuleStoreTestCase):
|
||||
"""
|
||||
Tests for the Course Info page
|
||||
"""
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super(CourseInfoTestCase, cls).setUpClass()
|
||||
@@ -263,6 +264,7 @@ class SelfPacedCourseInfoTestCase(LoginEnrollmentTestCase, SharedModuleStoreTest
|
||||
"""
|
||||
Tests for the info page of self-paced courses.
|
||||
"""
|
||||
ENABLED_CACHES = ['default', 'mongo_metadata_inheritance', 'loc_cache']
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
|
||||
@@ -151,6 +151,8 @@ class TestMaxScoresCache(SharedModuleStoreTestCase):
|
||||
Tests for the MaxScoresCache
|
||||
"""
|
||||
|
||||
ENABLED_CACHES = ['default', 'mongo_metadata_inheritance', 'loc_cache']
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super(TestMaxScoresCache, cls).setUpClass()
|
||||
|
||||
@@ -127,6 +127,8 @@ class TestSubmittingProblems(ModuleStoreTestCase, LoginEnrollmentTestCase, Probl
|
||||
COURSE_SLUG = "100"
|
||||
COURSE_NAME = "test_course"
|
||||
|
||||
ENABLED_CACHES = ['default', 'mongo_metadata_inheritance', 'loc_cache']
|
||||
|
||||
def setUp(self):
|
||||
super(TestSubmittingProblems, self).setUp()
|
||||
|
||||
|
||||
@@ -970,6 +970,8 @@ class ProgressPageTests(ModuleStoreTestCase):
|
||||
Tests that verify that the progress page works correctly.
|
||||
"""
|
||||
|
||||
ENABLED_CACHES = ['default', 'mongo_modulestore_inheritance', 'loc_cache']
|
||||
|
||||
def setUp(self):
|
||||
super(ProgressPageTests, self).setUp()
|
||||
self.request_factory = RequestFactory()
|
||||
|
||||
Reference in New Issue
Block a user