Commit Graph

138 Commits

Author SHA1 Message Date
Calen Pennington
1f17538d42 Clean up tests in preparation for switching Vertical from an XModule to an XBlock 2015-03-30 16:37:53 -04:00
Jonathan Piacenti
8ad4d081fb Added library import and export via .tar.gz'd XML files. 2015-03-10 21:29:29 +00:00
stv
2e1400f842 Fix Pylint: W0613(unused-argument) 2015-02-19 19:56:51 -08:00
stv
91eb723946 Remove obsolete management command
While this may have served a purpose at one point, it's now been broken
for more than 2 years [1]; a critical code path makes a call to a
function which is no longer imported.

[1] commit 84cb0ce99b
    Date:   Fri Dec 21 13:15:37 2012 -0500
2015-02-16 22:50:11 -08:00
cahrens
d86c7bec3c Update for renamed test split modulestore. 2015-02-09 10:00:33 -05:00
cahrens
149c4e78c1 Update tests in reaction to ModuleStoreTestCase cleanup. 2015-02-09 10:00:32 -05:00
cahrens
c56c88be4a create_xmodule was renamed to create_xblock, and mixed modulestore has create_xblock method.
Split modulestore throws duplicate errors if course locator is not unique.
2015-02-09 10:00:32 -05:00
cahrens
7a64e6f69f Support running test with split modulestore as the default.
With split, "name" returns "course" instead of the run name.
2015-02-09 10:00:32 -05:00
Calen Pennington
2bb1aafaaf Merge pull request #6752 from cpennington/modulestore-test-case-cleanup
Clean up ModuleStoreTestCase
2015-02-04 15:57:01 -05: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
Sarina Canelake
01064fcc79 Fix logging calls to use unicode, and lazy logging 2015-02-04 10:53:33 +02:00
Omar Al-Ithawi
4e733c6e1f Unicode fixes for log messages and other things 2015-02-04 09:55:44 +02:00
Jesse Zoldak
e26a0c4308 Fix pep8 violations in some tests 2014-12-02 09:39:23 -05:00
Jesse Zoldak
bf3b87bc64 Clean up all modulestore testcases
Move modulestore config for tests to an importable location
Disable pylnt warning for lms imports in common tests
Refactor all testcases that loaded all xml courses
TE-610
TE-489
2014-12-02 07:09:36 -05:00
Sarina Canelake
5f723e8d3c s/pylint: disable=W0703/pylint: disable=broad-except/ 2014-12-01 11:22:11 -05:00
Muhammad Ammar
e8e7e78e09 Merge pull request #5655 from edx/ammar/unit-improvements
Unit Test Improvements
2014-11-05 19:55:39 +05:00
Sarina Canelake
725e4908e3 Remove more pep8 violations 2014-11-04 07:37:41 -05:00
Carlos Andrés Rocha
6ad235f5db Ignore errors during cleanup of course export command. 2014-10-31 15:20:17 -04:00
muhammad-ammar
fcaa783e43 Unit Test Improvements
TE-489
2014-10-31 11:55:13 +00:00
Carlos Andrés Rocha
a1a7504f81 Fix dump course structure when element metadata uses opaque keys.
Make sure that during the serialization, all opaque keys and their
references and serialized using the `unicode` function.

AN-3821
2014-10-22 12:36:50 -04:00
Brian Wilson
61c2b96a4a Only permit ascii characters in filenames generated from course_ids. 2014-10-08 11:43:07 -04:00
Brian Wilson
e26b86de60 Make sure temporary course directory uses safe characters. 2014-10-07 22:28:00 -04:00
zubair-arbi
bdf2c28641 update video module to always set download_video field on export 2014-09-22 13:15:40 +05:00
Nimisha Asthagiri
ea32529866 Fix all modulestore calls to pass in user ids. 2014-07-09 21:10:12 -04:00
Nimisha Asthagiri
a9213509c3 Enable Mixed Modulestore STUD-1540
Refactor get_parent_locations STUD-1663
2014-06-26 18:00:11 -04:00
Calen Pennington
cfcbdc0145 Move to OpaqueKey implementations from the external library
[LMS-2757]
2014-05-29 17:03:35 -04:00
Diana Huang
db0cd78152 Remove some outdated code. 2014-05-22 15:39:29 -04:00
Calen Pennington
9811926d97 Make course ids and usage ids opaque to LMS and Studio [partial commit]
This commit updates lms/djangoapps/courseware.

These keys are now objects with a limited interface, and the particular
internal representation is managed by the data storage layer (the
modulestore).

For the LMS, there should be no outward-facing changes to the system.
The keys are, for now, a change to internal representation only. For
Studio, the new serialized form of the keys is used in urls, to allow
for further migration in the future.

Co-Author: Andy Armstrong <andya@edx.org>
Co-Author: Christina Roberts <christina@edx.org>
Co-Author: David Baumgold <db@edx.org>
Co-Author: Diana Huang <dkh@edx.org>
Co-Author: Don Mitchell <dmitchell@edx.org>
Co-Author: Julia Hansbrough <julia@edx.org>
Co-Author: Nimisha Asthagiri <nasthagiri@edx.org>
Co-Author: Sarina Canelake <sarina@edx.org>

[LMS-2370]
2014-05-06 10:08:32 -04:00
Carlos Andrés Rocha
e5c042aa4f Improve dump_course_ids test for unicode course_ids 2014-03-14 10:21:31 -04:00
Carlos Andrés Rocha
9ecf2c00c0 Support unicode in course ids when dumping all courses
Fixes: AN-657
2014-03-12 18:02:05 -04:00
Sarina Canelake
87495891b6 Fix some simple pep8 and pylint violations 2014-03-07 12:20:28 -05:00
Ned Batchelder
1bd213beba Remove unused imports. 2014-02-10 14:07:50 -05:00
Calen Pennington
b0bed170de Enable (and test) xml export of pure XBlocks
[LMS-179]
[LMS-209]
[LMS-1345]
2014-02-05 13:02:40 -05:00
Calen Pennington
46109bb3e8 Use XBlock xml serialization and deserialization
XModules continue to use their own interface for xml, but provide an
adaptor that makes the the XBlock interface available.

[LMS-179]
2014-01-14 13:28:47 -05:00
Ned Batchelder
b6bd293266 Clean up some pre-existing formatting. 2014-01-14 13:09:35 -05:00
Brian Wilson
d0fea42902 Add tests for inherited metadata to test_dump_course, and move to commands/tests dir. 2014-01-03 10:32:42 -05:00
Brian Wilson
4569ee9daa Add options to dump_course_structure to output inherited metadata. 2014-01-03 10:32:42 -05:00
Carson Gee
ccc87337d6 Add sysadmin dashboard
For seeing overview of system status, for deleting and loading
courses, for seeing log of git imports of courseware.  Includes command
for importing course XML from git repositories.

Added a lot of tests for additional coverage with some minor fixes
those tests discovered
2013-12-15 19:06:05 -05:00
Carlos Andrés Rocha
b797e34deb Allow the export_course command to dump results to stdout 2013-10-28 11:47:44 -04:00
Carlos Andrés Rocha
7852b10753 Add command to dump a course to stdout as a tar.gz file 2013-10-15 10:48:59 -04:00
Carlos Andrés Rocha
8cc8608276 Add command to dump the structure of a course as a JSON 2013-10-15 10:48:59 -04:00
Carlos Andrés Rocha
956a960c63 Add command to dump the course_ids available to the LMS 2013-10-15 10:48:59 -04:00
Calen Pennington
8201b1412e Use XBlock 0.3 2013-09-06 09:45:59 -04:00
Calen Pennington
7d79f4fe37 Move mitxmako initialization to a startup module, called by lms.startup and cms.startup for both management commands and when run via wsgi
[DEVPAIN-7]
2013-08-28 10:56:07 -04:00
Ned Batchelder
900e794c02 Only quiet the particular logger we think is too noisy. 2013-07-18 11:53:21 -04:00
Ned Batchelder
3d67c506a3 Use TransactionTestCase, to keep other tests from failing, even though it slows them down. 2013-07-18 11:16:46 -04:00
Ned Batchelder
10f062cf18 Records should be sorted by created,id so that timestamp ties will be broken by id. 2013-07-18 11:16:46 -04:00
Ned Batchelder
83cb3d1924 Add batch and sleep arguments so we can control the speed from the command line. 2013-07-18 11:16:46 -04:00
Ned Batchelder
3a49136f03 Quiet some debug output, get transactions right. 2013-07-18 11:16:46 -04:00