Commit Graph

69 Commits

Author SHA1 Message Date
usamasadiq
f9cfbf027c Ran pyupgrade on lms/djangoapps
Ran pyupgrade on lms/djangoapps/lms_xblock
Ran pyupgrade on lms/djangoapps/lti_provider
2021-02-20 21:46:03 +05:00
Aarif
87fbbc7f3b replaced unittest assertions pytest assertions (#26547) 2021-02-19 12:36:28 +05:00
Awais Qureshi
28307c0a0a BOM-2283
Apply pylint-amnesty.
2021-02-02 11:31:34 +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
d1a775d3cd Use full names for lms.djangoapps imports (#25401)
* Use full LMS imports paths in LMS settings and urls modules
* Use full LMS import paths in Studio settings and urls modules
* Import from lms.djangoapps.badges instead of badges
* Import from lms.djangoapps.branding instead of branding
* Import from lms.djangoapps.bulk_email instead of bulk_email
* Import from lms.djangoapps.bulk_enroll instead of bulk_enroll
* Import from lms.djangoapps.ccx instead of ccx
* Import from lms.djangoapps.course_api instead of course_api
* Import from lms.djangoapps.course_blocks instead of course_blocks
* Import from lms.djangoapps.course_wiki instead of course_wiki
* Import from lms.djangoapps.courseware instead of courseware
* Import from lms.djangoapps.dashboard instead of dashboard
* Import from lms.djangoapps.discussion import discussion
* Import from lms.djangoapps.email_marketing instead of email_marketing
* Import from lms.djangoapps.experiments instead of experiments
* Import from lms.djangoapps.gating instead of gating
* Import from lms.djangoapps.grades instead of grades
* Import from lms.djangoapps.instructor_analytics instead of instructor_analytics
* Import form lms.djangoapps.lms_xblock instead of lms_xblock
* Import from lms.djangoapps.lti_provider instead of lti_provider
* Import from lms.djangoapps.mobile_api instead of mobile_api
* Import from lms.djangoapps.rss_proxy instead of rss_proxy
* Import from lms.djangoapps.static_template_view instead of static_template_view
* Import from lms.djangoapps.survey instead of survey
* Import from lms.djangoapps.verify_student instead of verify_student
* Stop suppressing EdxPlatformDeprecatedImportWarnings
2020-11-04 08:48:33 -05:00
Calen Pennington
a04690d051 Increase the mongo query count by one because edxnotes has been turned back on, and it loads the course from the modulestore as part of get_html 2020-09-25 14:13:30 -04:00
Calen Pennington
2a157ae854 Lower query counts 2020-09-23 10:05:37 -04:00
Calen Pennington
4a120a9e26 Fix failures caused by removing lms/djangoapps from sys.path 2020-09-23 10:05:37 -04:00
usama sadiq
889f7d492d Updated LtiBackend.authenticate() method
Added a positional `request` arugment in the function header.
2020-01-10 17:00:22 +05:00
Feanil Patel
6e3fe00fff Fix all E303 pep8 errors. 2019-12-30 12:25:38 -05: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
Ned Batchelder
efba6e45e8 Finally import courseware properly everywhere to get rid of a warning 2019-09-26 09:40:15 -04:00
Ayub khan
5ab7d84d76 BOM-280
python3 compatibility
2019-09-06 15:03:07 +05:00
Stu Young
a10c4186e5 incr-311 (#20614)
* run python modernize

* run isort
2019-05-15 14:23:02 -04:00
Calen Pennington
8c53ce6493 Merge pull request #19743 from edx/unicode7
fix unicode strings in lms/ part 2
2019-02-13 14:15:02 -05:00
Matthew Piatetsky
764319d3e0 fix unicode strings in lms/ part 2 2019-02-13 10:35:56 -05:00
Michael Youngstrom
3221c2b91f Remove lms pytest shards 2019-02-12 11:03:46 -05:00
Jeremy Bowman
4e8668d3be TE-2524 Stop using nose.plugins - LMS 2 2018-08-01 13:54:06 -04:00
Brian Mesick
832f6a7157 Merge pull request #18320 from edx/bmedx/remove_111_test_marks
Remove unused pytest markers for Django 1.11 upgrade
2018-06-06 11:15:26 -04:00
bmedx
c125ff6a57 Remove unused pytest markers for Django 1.11 upgrade 2018-06-06 09:58:38 -04:00
Eric Fischer
247bb50ed2 s/django.core.urlresolvers/django.urls/g
Django 1.10 deprecation fix for Hackathon XIX
Addresses PLAT-1397
2018-06-05 13:59:09 -04:00
Stuart Young
1fd2167144 rebalance python unittests onto new shards 2018-05-03 11:16:05 -04:00
Eric Fischer
4147b72f18 fix is_authenticated mocks 2018-05-02 11:26:27 -04:00
Eric Fischer
e18448e27d Silence deprecation warnings
https://docs.djangoproject.com/en/1.11/releases/1.10/#using-user-is-authenticated-and-user-is-anonymous-as-methods
2018-05-02 10:03:50 -04:00
Eric Fischer
9b093ff17f Add passthrough for context_title and context_label LTI parameters 2018-04-18 13:39:53 -04:00
John Eskew
c55aa9e1d5 Change POST request upon creation only. 2018-01-25 11:33:44 -05:00
bmedx
b5d6fca44e Update is_authenticated patches to work with Django 1.10+ 2017-12-22 13:22:49 -05:00
bmedx
ace88e7d5a Tag LMS Unit 3 tests that fail in Django 1.11
Fixed some url reverse errors instead of marking since they were trivial
2017-11-22 15:48:00 -05:00
Ned Batchelder
e23e3a0486 Fix a number of unused-import pylint violations 2017-11-21 19:57:06 -05:00
Nimisha Asthagiri
1febdbfac9 Grades cleanup: remove read_only param and create method
EDUCATOR-171
2017-09-28 07:48:25 -04:00
Andy Armstrong
79acb5c5be Reorder LMS imports using isort 2017-06-11 21:48:06 -04:00
Ned Batchelder
4a568476fd Remove a number of unneeded super()-delegation methods 2017-04-27 14:12:56 -04:00
cahrens
e5035746bf Introduce EnrollmentTrackUserPartition.
TNL-6674
2017-03-30 12:24:48 -04:00
Dmitry Viskov
fc0577d081 Hide bookmarks link in the LTI mode 2016-12-22 09:56:33 -05:00
asadazam93
01f3233a50 Fix InvalidKeyError on render xblock 2016-12-20 13:03:50 +05:00
Nimisha Asthagiri
e87388e24c Grades cleanup before updating grade report
Remove deprecated SingleSectionGrader.  TNL-5987
Remove display_name and module_id from Scores objects
Update CourseGradeFactory.__init__ to not be user-specific
Update some callers to use CourseGrade class instead of "summary" dict
Remove no longer needed course_grades.py module.
Renamed django signal from GRADES_UPDATED to COURSE_GRADE_CHANGED
2016-11-30 12:36:25 -05:00
Dmitry Viskov
693408eb4e Ability to create two or more LTI consumers through the Django admin with an empty instance_guid field. 2016-11-18 18:43:26 +03:00
Pan Luo
18648b52fc Fix the duplicate oauth_body_hash in the outcomes request
The "oauth_body_hash" appeared twice in the auth header in the request
when posting grade back to tool consumer. However, the signature sent
from edX is calculated based on only one oauth_body_hash.
On the tool consumer side, the signature is calculated based on the auth
header and will use the duplicated fields. So the signatures will not match.
And request will fail the signature validation.

The bug was introduced in this commit:
03cee389e0
on July 12th by updating the oauthlib.

Because 0.7.2(original version) doesn't have oauth_body_hash support, so a custom
OAuth1 client was implemented to add oauth_body_hash to the headers:
f5d0f3ff55/lms/djangoapps/lti_provider/outcomes.py (L24).
However, the new oauthlib 1.0.3 has support for oauth_body_hash
(51675237c4 (diff-c2a1e5f1ddfe8e48ff62b59eb952644eR180)).
So after updating library, oauth_body_hash is added twice.

This fixes the bug by removing the custom client and use the oauthlib
default client to generate the auth header.
2016-09-13 09:33:07 -04:00
Calen Pennington
bc20a37c2b Simplify how shards are selected in CI 2016-08-03 16:23:02 -04:00
Ned Batchelder
8571ceabeb Fix many wrong-assert-type errors 2016-08-03 12:44:41 -04:00
Nimisha Asthagiri
1ada5c3487 Create Grades djangoapp
https://openedx.atlassian.net/browse/TNL-5008
2016-07-22 00:09:43 -04:00
Calen Pennington
1537f0407a Mock SignatureValidator.verify using patch so that the mock is unset at the end of the test 2016-06-07 10:01:40 -04:00
Ben Patterson
b9558a90f1 Create a 3rd explicit shard for unit tests.
More accurately, this creates a 4th shard because the
last shard is always the default.
2016-04-28 10:09:32 -04:00
Ned Batchelder
43ac38aa87 Add autospec to all mocks 2015-12-09 09:44:22 -05:00
Ned Batchelder
f5d0f3ff55 Remove useless pylint suppressions 2015-11-22 07:41:19 -05:00
Usman Khalid
6cb62f2697 Rebase upgrade Django to v1.8.5
Please note that this is a squshed commit and the work of:
Symbolist, macdiesel, nedbat, doctoryes, muzaffaryousaf and muhammad-ammar
2015-11-10 15:00:19 -05:00
Nimisha Asthagiri
31d5d513f8 MA-1337 xBlock Rendering View 2015-09-21 16:17:11 -04:00
Calen Pennington
dbfa6dafed Resolve conflicts in merge to master 2015-09-04 08:50:48 -04:00
Calen Pennington
821cc59415 Merge master into release-2015-09-02, leaving conflicts 2015-09-03 16:36:56 -04:00
David Ormsbee
f577a6d278 Add body hash to LTI outcome message.
This is necessary to properly implement the LTI outcome passback
spec. It was not included previously because it was causing problems
with Canvas, but Blackboard will not accept outcomes unless they are
properly signed.

The requests_oauthlib doesn't support the body hash spec out of the
box, so BodyHashClient needed to be made. Fortunately, it's a pretty
simple spec:

https://oauth.googlecode.com/svn/spec/ext/body_hash/1.0/oauth-bodyhash.html
2015-09-01 15:29:00 -04:00