Commit Graph

66 Commits

Author SHA1 Message Date
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
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
stv
500499b678 Fix PEP8: E231 missing whitespace after '[:,]' 2014-11-10 19:31:05 -08:00
stv
cf9308144d Fix PEP8: E302 expected 2 blank lines, found 1 2014-11-10 11:00:11 -08:00
muhammad-ammar
fcaa783e43 Unit Test Improvements
TE-489
2014-10-31 11:55:13 +00:00
Usman Khalid
548b01ab7c Disable http range requests in pdf.js.
A bug in pdf.js or Chrome is causing pdf books to not load.

TNL-488
2014-10-01 18:12:30 +05:00
Usman Khalid
d36e00d4a5 Pass storage_url and token values as parameters to StudentNotes init.
LMS-2848
2014-06-23 16:38:02 +05:00
Calen Pennington
cfcbdc0145 Move to OpaqueKey implementations from the external library
[LMS-2757]
2014-05-29 17:03:35 -04:00
Calen Pennington
155ffe37ca Merge remote-tracking branch 'edx/master' into opaque-keys-merge-master
Conflicts:
	cms/djangoapps/contentstore/views/item.py
	cms/djangoapps/contentstore/views/tests/test_container.py
	cms/djangoapps/contentstore/views/tests/test_tabs.py
	common/lib/xmodule/xmodule/modulestore/mongo/draft.py
	lms/djangoapps/certificates/management/commands/gen_cert_report.py
	lms/djangoapps/certificates/queue.py
	lms/djangoapps/certificates/views.py
	lms/djangoapps/courseware/module_render.py
	lms/djangoapps/courseware/tests/test_module_render.py
	lms/djangoapps/instructor/views/api.py
	lms/djangoapps/instructor/views/instructor_dashboard.py
	lms/djangoapps/instructor/views/legacy.py
	lms/djangoapps/shoppingcart/tests/test_models.py
	lms/djangoapps/verify_student/views.py
2014-05-09 15:29:32 -04:00
Calen Pennington
cd746bf8e5 Make course ids and usage ids opaque to LMS and Studio [partial commit]
This commit adds the non-courseware lms/djangoapps and lms/lib.

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-08 12:09:23 -04:00
Dave St.Germain
14f2f67c78 Set the page in the correct place. 2014-04-28 17:01:03 -04:00
Carson Gee
6136ed2e13 Switch PDF Textbooks to use portable URLs 2014-04-16 13:05:25 -04:00
Dave St.Germain
1cf2696289 Added analytics event logging to PDF book viewer 2014-04-14 17:55:53 -04:00
Dave St.Germain
b0a7443570 updated pdf viewer 2014-03-20 17:00:41 -04:00
daniel cebrian
7e2652b5a8 annotation tools
First set of fixes from the pull request

This does not include some of the testing files. The textannotation and
videoannotation test files are not ready. waiting for an answer on the
issue.

Deleted token line in api.py and added test for token generator

Added notes_spec.coffee

remove spec file

fixed minor error with the test

fixes some quality errors

fixed unit test

fixed unit test

added advanced module

Added notes_spec.coffee

remove spec file

Quality and  Testing Coverage

1. in test_textannotation.py I already check for line 75 as it states
in the diff in line 43, same with test_videoanntotation
2. Like you said, exceptions cannot be checked for
firebase_token_generator.py. The version of python that is active on
the edx server is 2.7 or higher, but the code is there for correctness.
Error checking works the same way.
3. I added a test for student/views/.py within tests and deleted the
unused secret assignment.
4. test_token_generator.py is now its own file

Added Secret Token data input

fixed token generator

Annotation Tools in Place

The purpose of this pull request is to install two major modules: (1) a
module to annotate text and (2) a module to annotate video. In either
case an instructor can declare them in advanced settings under
advanced_modules and input content (HTML in text, mp4 or YouTube videos
for video). Students will be able to highlight portions and add their
comments as well as reply to each other. There needs to be a storage
server set up per course as well as a secret token to talk with said
storage.

Changes:
1. Added test to check for the creation of a token in tests.py (along
with the rest of the tests for student/view.py)
2. Removed items in cms pertaining to annotation as this will only be
possible in the lms
3. Added more comments to firebase_token_generator.py, the test files,
students/views.py
4. Added some internationalization stuff to textannotation.html and
videoannotation.html. I need some help with doing it in javascript, but
the html is covered.

incorporated lib for traslate

fixed quality errors

fixed my notes with catch token

Text and Video Annotation Modules - First Iteration

The following code-change is the first iteration of the modules for
text and video annotation.

Installing Modules:
1. Under “Advanced Settings”, add “textannotation” and
“videoannotation” to the list of advanced_modules.
2. Add link to an external storage for annotations under
“annotation_storage_url”
3. Add the secret token for talking with said storage under
“annotation_token_secret”

Using Modules
1. When creating  new unit, you can find Text and Video annotation
modules under “Advanced” component
2. Make sure you have either Text or Video in one unit, but not both.
3. Annotations are only allowed on Live/Public version and not Studio.

Added missing templates and fixed more of the quality errors

Fixed annotator not existing issue in cmd and tried to find the get_html() from the annotation module class to the descriptor

Added a space after # in comments

Fixed issue with an empty Module and token links

Added licenses and fixed vis naming scheme and location.
2014-01-27 13:47:58 -05:00
David Baumgold
8eff442752 mitxmako => edxmako 2013-12-03 14:15:09 -05:00
Usman Khalid
3c3edac05f Fixed tests name in staticbook 2013-09-23 12:58:14 +00:00
Usman Khalid
d8e9ffbb0b Added missing test in StaticImageBookTest 2013-09-19 12:38:32 +00:00
Will Daly
8165a033b1 Pep8/pylint fixes
Fixed test_masquerade failure due to not clearing the modulestore
between tests.
2013-08-21 19:42:59 -04:00
Will Daly
48c6daacb8 Removed unnecessary settings wrangling from ModuleStoreTestCase.
Modified navigation tests to use MixedModulestore
Updated factories to find editable modulestore

Updated test_submitting_problems

Updated test_tabs.py

Updated test_view_authentication

Updated test_views

Updated courseware/tests/tests.py

Updated test_masquerade

Updated test_module_render

Pylint fixes

Updated video and word cloud tests

Updated course wiki tests

Updated license and open_ended tests.
One open_ended test still failing due to Mako initialization issues

Updated staticbook

Updated django_comment_client tests

Updated instructor tests

Updated instructor task tests

Updated external_auth tests

Updated course_groups
2013-08-21 09:36:45 -04:00
Chris Dodge
5298f54f4c fix tests 2013-08-15 22:58:02 -04:00
Chris Dodge
cff93d324b WIP 2013-08-15 22:58:02 -04:00
Ned Batchelder
1d5dfaa131 Add tests for image books, and more tests for the other kinds too. 2013-07-03 14:42:41 -04:00
Ned Batchelder
959274c730 Adapt the tests to the new way of making URLs. 2013-07-02 17:08:37 -04:00
Ned Batchelder
27c70ead1b Tests and CHANGELOG for LMS-530 2013-07-02 13:30:00 -04:00
Ned Batchelder
f6b0ffd01f Make some helpers for the tests. 2013-07-02 11:48:03 -04:00
Ned Batchelder
4ff2de69e7 Pylint fixes 2013-07-02 11:36:47 -04:00
Ned Batchelder
25d0f4d500 Remove unused URL /book-shifted/ 2013-07-02 11:36:47 -04:00
Ned Batchelder
6c3563cc1a Simple refactoring and reformatting of the view code. 2013-07-02 11:36:47 -04:00
Ned Batchelder
b5aebf0e02 Tests for staticbook 2013-07-02 11:36:47 -04:00
Ned Batchelder
a484224ef5 Remove pointless addition tests 2013-06-27 16:27:39 -04:00
Ned Batchelder
61b53713d2 Remove unused imports from lms, as detected by pylint. 2013-06-19 16:56:34 -04:00
Arthur Barrett
4070e019e4 modified the html static book to only enable annotator.js when notes are enabled for the course 2013-05-06 19:29:44 -04:00
Arthur Barrett
04e75485ba merged master branch into feature/abarrett/lms-notes-app. resolved conflicts in lms/envs/common.py and lms/templates/static_htmlbook.html. 2013-05-06 13:40:38 -04:00
Brian Wilson
2d9deaf38c remove code for supporting anchor_id on html textbooks, since it doesn't work 2013-04-12 11:53:06 -04:00
Brian Wilson
123cfa333f add documentation for HTML textbook 2013-04-11 16:42:14 -04:00
Arthur Barrett
7784a29e61 add simple notes view 2013-03-26 14:47:12 -04:00
Arthur Barrett
7120998938 refactoring notes js 2013-03-21 17:18:45 -04:00
Calen Pennington
324d286f9b Don't reference .metadata for data_dir 2013-03-13 12:47:05 -04:00
Calen Pennington
2113541632 Merge remote-tracking branch 'origin/master' into feature/alex/poll-merged
Conflicts:
	.ruby-version
	cms/djangoapps/contentstore/tests/test_contentstore.py
	cms/djangoapps/models/settings/course_metadata.py
	common/lib/xmodule/xmodule/course_module.py
	common/lib/xmodule/xmodule/modulestore/tests/factories.py
2013-03-12 07:23:28 -04:00
Brian Wilson
2199ae673b add checks that book_index is in range 2013-03-11 11:10:08 -04:00
Brian Wilson
bed7dbdb6b fix plumbing for anchors and chapters. 2013-03-08 18:25:33 -05:00
Calen Pennington
cec3475c9d Remove references to .definition and .metadata in modules 2013-03-06 18:07:56 -05:00
Brian Wilson
b5ab766092 initial framework for htmlbook 2013-03-06 17:57:33 -05:00
Brian Wilson
dde2cd0bd0 get chapter links to start working 2013-02-25 16:52:32 -05:00
Brian Wilson
fa00ea442e add first pass at multi-chapter support. 2013-02-25 01:26:34 -05:00
Brian Wilson
6d174ef029 remove dead code 2013-02-21 15:41:28 -05:00
Brian Wilson
0d3b566dd8 finish piping URL through to pdf.js 2013-02-14 15:47:53 -05:00
Brian Wilson
f0258b8dd0 first pass at pdfbook 2013-02-13 18:01:44 -05:00
Calen Pennington
cfae1cdf62 Pep8 autofixes 2013-02-06 11:13:50 -05:00