Commit Graph

9 Commits

Author SHA1 Message Date
Sarina Canelake
ba8fd1c21d Eliminate instances of unused-import Pylint violation 2015-07-13 17:33:25 -04:00
Adam Palay
d9a21bdf4d use email context for keyword substitution, cutting down on db queries (TNL-1591) 2015-04-08 11:22:26 -04:00
Calen Pennington
b353ed2ea2 Better support specifying of modulestore configuration in test cases
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]
2015-02-04 09:09:14 -05:00
Calen Pennington
03a05fd9d4 Always call super(..).setUp() from setUp 2015-02-04 09:09:14 -05:00
njdup
32bbb0e71a Implements keyword sub feature for bulk emails
This commit pulls in changes from #4487 that implements keyword
substitution for bulk emails. With these changes, an instructor can
include keywords in their bulk emails which will be automatically substituted
with the corresponding value for the recepient of the email. Keywords are
of the form %%keyword%%, and the keywords implemented in this commit include:

%%USER_ID%% => anonymous_user_id
%%USER_FULLNAME%% => user profile name
%%COURSE_DISPLAY_NAME%% => display name of the course
%%COURSE_END_DATE%% => end date of the course

Client-side validations have also been implemented to ensure that only emails
with well-formed keywords can be sent.
The architecture is designed such that adding in new keywords in the future
would be relatively straight-forward.
2014-12-11 15:03:29 -08:00
Sarina Canelake
725e4908e3 Remove more pep8 violations 2014-11-04 07:37:41 -05:00
Adam Palay
5fa38cb59e add simple help-modal-test 2014-09-22 09:34:32 -04:00
Alan Boudreault
57025cd5e6 Add missing mimetypes for xblock resources 2014-05-29 11:14:00 -04:00
Usman Khalid
12c2e1bfee Test TemplateLookup dirs are not cleared during lms startup.
LMS-2498
2014-04-03 20:23:44 +05:00