This moves the functionality of the 'export_course' management command from lms/djangoapps/courseware
over to the Studio codebase. This reflects its use going forward to be run with cms settings, to
export the content of the Studio modulestore instead of the LMS modulestore. The management
command is used by an analytics workflow to output course content for researchers.
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]
https://docs.djangoproject.com/en/1.8/howto/custom-management-commands/
You need to declare and do proper argument parsing. --commit is also
more natural than a bare 'commit' on the end of a command.
Switch from calling handle() directly to call_command().
call_command() simulates using the management command so is a better
test of the command line interface.
With the 1.8 upgrade, we stopped using 'manage.py cms command commit'
and switched to --commit because we no longer directly access args[]
https://docs.djangoproject.com/en/1.8/howto/custom-management-commands/
When this command was updated, it was switched to --commit=commit, but
using store_true allows a much more natural --commit syntax.
The print_out_all_courses() routine consumes a ton of memory (2G and
causes noticable mongo usage spikes). This actually causes other
processes on production boxes to be memory starved and killed
(such as worker children on edge when this was run recently).
The behavior of this script on production is
* Print several hundred courses
* Ask if you want to delete the one you specified
* print several hundred courses minus one
On a sandbox with 5 courses, you could tell by eye that 1 is gone, but
not in production (or even in stage).
The original PLAT-619 ticket for this suggested printing a course
listing on error, but instead it always printed the course listing.
Even in the error case, hundreds of course ids is confusing and obscures
the error message saying that your course_id is invalid.
You should be getting the course id from the UI or from ./manage.py lms
dump_course_ids, not by searching a list.
Adjusted the test accordingly
Remove get_courses_keys
The old line:
from path import path
produced pylint errors because of the baroque way that path.py defined
"path". We tried to get them to change how they defined it, but they
deleted the name instead: https://github.com/jaraco/path.py/issues/102
(Jason then changed his mind, but this is a better way to use path.py,
it avoids the pylint error at least.)
TNL-3014
Add tests for search
Add text_search to TeamsListView
Add reindex command line tool for course teams
Add Search Pagination and update comments
Move paginate_search_results to common library
Update edx-lint to the version that checks if tearDown uses super.
Convert a number of tearDown methods into addCleanup.
Remove some unneeded tearDown methods: no need to call patch.stopall if
none of them were started with patch.start.