The existing pattern of using `override_settings(MODULESTORE=...)` prevented us from having more than one layer of subclassing in modulestore tests. In a structure like: @override_settings(MODULESTORE=store_a) class BaseTestCase(ModuleStoreTestCase): def setUp(self): # use store @override_settings(MODULESTORE=store_b) class ChildTestCase(BaseTestCase): def setUp(self): # use store In this case, the store actions performed in `BaseTestCase` on behalf of `ChildTestCase` would still use `store_a`, even though the `ChildTestCase` had specified to use `store_b`. This is because the `override_settings` decorator would be the innermost wrapper around the `BaseTestCase.setUp` method, no matter what `ChildTestCase` does. To remedy this, we move the call to `override_settings` into the `ModuleStoreTestCase.setUp` method, and use a cleanup to remove the override. Subclasses can just defined the `MODULESTORE` class attribute to specify which modulestore to use _for the entire `setUp` chain_. [PLAT-419]
Name |
Last commit
|
Last update |
---|---|---|
.. | ||
branding | Loading commit data... | |
bulk_email | Loading commit data... | |
certificates | Loading commit data... | |
circuit | Loading commit data... | |
class_dashboard | Loading commit data... | |
course_wiki | Loading commit data... | |
courseware | Loading commit data... | |
dashboard | Loading commit data... | |
debug | Loading commit data... | |
django_comment_client | Loading commit data... | |
edxnotes | Loading commit data... | |
foldit | Loading commit data... | |
instructor | Loading commit data... | |
instructor_analytics | Loading commit data... | |
instructor_task | Loading commit data... | |
licenses | Loading commit data... | |
lms_migration | Loading commit data... | |
lms_xblock | Loading commit data... | |
mobile_api | Loading commit data... | |
notes | Loading commit data... | |
notification_prefs | Loading commit data... | |
notifier_api | Loading commit data... | |
oauth2_handler | Loading commit data... | |
open_ended_grading | Loading commit data... | |
psychometrics | Loading commit data... | |
shoppingcart | Loading commit data... | |
static_template_view | Loading commit data... | |
staticbook | Loading commit data... | |
student_account | Loading commit data... | |
student_profile | Loading commit data... | |
survey | Loading commit data... | |
verify_student | Loading commit data... | |
__init__.py | Loading commit data... |