Commit Graph

91 Commits

Author SHA1 Message Date
M. Zulqarnain
fa271dafe9 BOM-2369 (C): pyupgrade on contentstore/tests (#26759)
* pyupgrade on contentstore/tests
2021-03-04 14:37:39 +05:00
usamasadiq
7bbde8f0f5 Applied pylint-amnesty 2021-02-08 13:00:22 +05:00
Kyle McCormick
151bd13666 Use full names for common.djangoapps imports; warn when using old style (#25477)
* Generate common/djangoapps import shims for LMS
* Generate common/djangoapps import shims for Studio
* Stop appending project root to sys.path
* Stop appending common/djangoapps to sys.path
* Import from common.djangoapps.course_action_state instead of course_action_state
* Import from common.djangoapps.course_modes instead of course_modes
* Import from common.djangoapps.database_fixups instead of database_fixups
* Import from common.djangoapps.edxmako instead of edxmako
* Import from common.djangoapps.entitlements instead of entitlements
* Import from common.djangoapps.pipline_mako instead of pipeline_mako
* Import from common.djangoapps.static_replace instead of static_replace
* Import from common.djangoapps.student instead of student
* Import from common.djangoapps.terrain instead of terrain
* Import from common.djangoapps.third_party_auth instead of third_party_auth
* Import from common.djangoapps.track instead of track
* Import from common.djangoapps.util instead of util
* Import from common.djangoapps.xblock_django instead of xblock_django
* Add empty common/djangoapps/__init__.py to fix pytest collection
* Fix pylint formatting violations
* Exclude import_shims/ directory tree from linting
2020-11-10 07:02:01 -05:00
Kyle McCormick
538dbf696b Import CMS code using fully qualified module names
or, using proper the proper Python 3 relative imports
(e.g., 'from .views import x') which are standard and
unambiguous.
2020-10-19 09:34:31 -04:00
Feanil Patel
9cf2f9f298 Run 2to3 -f future . -w
This will remove imports from __future__ that are no longer needed.

https://docs.python.org/3.5/library/2to3.html#2to3fixer-future
2019-12-30 10:35:30 -05:00
David Ormsbee
9a1385585f Convert response bytes to str before JSON parsing. (#21375)
Convert response bytes to str before JSON parsing.
2019-08-19 11:01:55 -04:00
Ayub khan
ad2423fcc3 python3 compatibility 2019-07-09 15:22:19 +05:00
Jeremy Bowman
cd2e58e093 DEPR-16 Stop using deprecated OpaqueKey methods (#20248) 2019-04-16 17:59:16 -04:00
Mushtaq Ali
5a9477af30 Import video transcripts - EDUCATOR-2173 2018-04-16 12:05:44 +05:00
Jeremy Bowman
113e8dde61 PLAT-1885 Stop using deprecated BlockUsageLocator properties 2018-01-12 16:40:21 -05:00
bmedx
bc72c28a03 Remove unnecessary patches to User::is_authenticated 2017-12-22 11:33:35 -05:00
cahrens
6f71706b17 Remove SlashSeparatedCourseKey from tests. 2017-08-07 14:49:30 -04:00
Andy Armstrong
ebb04ca396 Reorder Studio imports using isort 2017-05-30 17:00:50 -04:00
Toby Lawrence
bb29ad5f30 Revert "Revert "[PERF-325] Add versioned course asset URLs when canonicalizing asset paths.""
This reverts commit 9967b6fd58.
2016-06-23 13:27:15 -04:00
Kevin Falcone
9967b6fd58 Revert "[PERF-325] Add versioned course asset URLs when canonicalizing asset paths."
We're seeing errors in NR from objects read out of the cache lacking the
'StaticContent' object has no attribute 'content_digest'
File "/edx/app/edxapp/edx-platform/common/djangoapps/contentserver/middleware.py",
    line 70, in process_request

This reverts commit 849ebc5f22.
2016-06-22 12:11:35 -04:00
Toby Lawrence
849ebc5f22 [PERF-325] Add versioned course asset URLs when canonicalizing asset paths. 2016-06-15 08:04:52 -04:00
Calen Pennington
18e1610043 Remove the create_user argument to setUp.
Instead, use a class attribute to define test behavior. This allows for
easier addition of new mixins over time.
2016-05-04 11:35:55 -04:00
Ned Batchelder
f5d0f3ff55 Remove useless pylint suppressions 2015-11-22 07:41:19 -05:00
Ned Batchelder
f54fe787c6 Remove needless 'disable=no-member' pragmas 2015-08-03 17:47:44 -04:00
Brandon DeRosier
5c6ccc8f0b Add CCX SQL query/mongo read tests 2015-06-15 09:50:44 -04:00
Syed Hassan Raza
c9778a5f57 add name param check_transcripts 2015-06-12 16:34:45 +05:00
Andy Armstrong
94e1c42314 Add extensible course view types for edX platform 2015-06-02 13:12:40 -04:00
Ned Batchelder
7d799e34f3 Remove unused imports 2015-03-17 07:10:31 -04:00
Jonathan Piacenti
8ad4d081fb Added library import and export via .tar.gz'd XML files. 2015-03-10 21:29:29 +00: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
Braden MacDonald
025f046b04 Fix errors with libraries when old mongo is default (first) modulestore 2015-01-21 11:01:52 -08:00
Nimisha Asthagiri
0687a62a8f Add back end for Studio video upload feature
This feature allows upload of video assets to S3. This requires that the
VIDEO_UPLOAD_PIPELINE setting be properly configured and that each
course be configured with a token issued by the media team for their
processing purposes (e.g. linking the video with a YouTube channel).

Co-authored-by: Greg Price <gprice@edx.org>
2014-12-15 13:09:59 -05:00
Adam Palay
27c710b85d don't export draft children of orphaned drafted (TNL-923) 2014-12-08 14:14:38 -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
19f1dacab2 s/pylint: disable=E1101/pylint: disable=no-member/ 2014-12-01 11:22:09 -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
muhammad-ammar
fcaa783e43 Unit Test Improvements
TE-489
2014-10-31 11:55:13 +00:00
Adam Palay
a6c31fc46b generalize draft import/export TNL-574
add test for videomodule

Import drafts handles modules w/o xml_attributes
and ones using the old parent_sequential_url pointer

Handle drafts for modules which don't define nor extract xml_attributes

Support  and  in get_items qualifiers

Unit test for   value query
2014-10-30 12:22:05 -04:00
Don Mitchell
b7b5400c3e Upgrade pymongo
LMS-11437
2014-10-09 11:55:14 -04:00
Don Mitchell
4ca5012f3c Use split to test views 2014-09-29 11:25:55 -04:00
Andy Armstrong
7b26e85478 Merge branch 'release' into andya/merge-hotfix-2014-08-29
Conflicts:
	cms/djangoapps/contentstore/tests/test_import.py
	common/lib/xmodule/xmodule/modulestore/__init__.py
	common/lib/xmodule/xmodule/modulestore/tests/test_mixed_modulestore.py
	lms/djangoapps/courseware/tests/test_module_render.py
2014-08-29 16:50:10 -04:00
Calen Pennington
3afc125ecb Add test to verify bad query behavior of xblock_handler 2014-08-29 14:09:41 -04:00
Don Mitchell
ee8fc41b62 compute_publish_state -> has_published_version
LMS-11213
2014-08-27 11:48:10 -04:00
Don Mitchell
3c3a316f08 Make it branch agnostic
LMS-11210

Conflicts:
	common/lib/xmodule/xmodule/modulestore/split_mongo/split_draft.py
2014-08-18 16:19:46 -04:00
Don Mitchell
e900a47b3f Provide workarounds for skip_draft where other code doesn't want its behavior 2014-08-08 15:00:47 -04:00
Nimisha Asthagiri
d2b59cb6e0 get_items API: have qualifiers be a separate parameter instead of assuming kwargs. 2014-08-08 12:38:42 -04:00
cahrens
932a130b16 pep8/pylint 2014-08-07 12:27:36 -04:00
Andy Armstrong
ef581e1146 Apply code review comments and fix tests 2014-08-07 12:27:14 -04:00
Andy Armstrong
a359065329 Integrate visual styling into the course outline 2014-08-07 12:27:13 -04:00
Andy Armstrong
f061bbc08b Backbone version of the course outline page
STUD-1726
2014-08-07 12:16:20 -04:00
cahrens
7cb5c4d7b8 Updates based on merge with master. 2014-08-07 12:16:18 -04:00
Nimisha Asthagiri
88ad29d166 LMS-11016 Studio server-side for course_listing and course_rerun.
Conflicts:
	cms/djangoapps/contentstore/tests/test_course_listing.py
2014-07-29 15:04:17 -04:00
Mathew Peterson
9a039e93ec Adding auto_publishing to split_draft
Added update_item, create_item, create_child to split_draft.py

Cleaned up TODOs in test_mixed_modulestore.py

Unit test for auto-publish

LMS-11017

Added tests to test_mixed_modulestore.py for has_changes and added black_list to _auto_publish

Moved DIRECT_ONLY_CATEGORIES to draft_and_publish.py

Deleted test_split_draft_modulestore.py

Added _auto_publish to create course

Publish cleanups for update_version, source_version

Changed has_changes to use source_version

Removing mixed test that no longer makes sense in auto_publish world

Addressed TODOs in test_branch_setting
2014-07-28 20:49:30 +00:00
Sarina Canelake
d0449cdff2 get_courses_for_wiki return course_keys across all modulestores [LMS-2914] 2014-07-21 17:17:48 -04:00
Calen Pennington
483e2a6a5d split create_item and create_child out as separate methods 2014-07-18 21:11:37 -04:00