Commit Graph

138 Commits

Author SHA1 Message Date
Usama Sadiq
b1b3ba9c81 refactor: ran pyugprade on lms/djangoapps/courseware (#26738) 2021-03-12 12:16:46 +05:00
Aarif
0112339b20 replaced unittest assertions pytest assertions (#26543) 2021-02-19 11:58:27 +05:00
Jawayria
03e6a874d0 Applied pylint-amnesty to courseware 2021-02-03 21:56:24 +05:00
Aarif
98af9ce418 remove useless-supression warnings 2020-05-01 19:42:15 +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
Feanil Patel
9740e2e077 BOM-618 Don't decode string objects. 2019-09-19 14:14:23 -04:00
Ayub khan
8a95a8e520 BOM-95
assertItemsEqual with six.assertCountEqual
2019-08-21 17:01:40 +05:00
aarif
61800c619f replaced StringIO imports with import from six
replaced cStringIO and StringIO imports with import from six

fixed StringIO imports

fixed StringIO imports

fixed XSS python-wrap warning
2019-08-08 00:09:16 +05:00
Ayub khan
7ca32f9197 INCR-433 python3 compatibility 2019-07-30 12:21:56 +05:00
Usman Khalid
0b27c62ca6 Convert VideoModule to VideoBlock.
Some deprecated functionality has been removed:

- Reading data field and transforms being applied in the init() method.
- The source field.
- The source_visible attribute.
2019-06-20 22:12:39 +05:00
alangsto
4a1346b068 INCR-265 Run python-modernize on lms/djangoapps/courseware/management and lms/djangoapps/courseware/tests (#20716)
* updated files according to INCR-265

* fixed docstring and line-length problems from quality test

* Revert "fixed docstring and line-length problems from quality test"

This reverts commit d050f55a4ecfaa38f46b80ec4bb85ff399a79a8c.

* fixed errors reported in quality report

* had error, fixed it

* reversed change

* fixed over/under indentation, and added line to import.py that Ned had suggested

* tried disabling pylint for this line

* testing new email

* testing email in different window

* re-added symlink and docstring
2019-05-31 14:07:18 -04:00
cclauss
c0c935b685 Old style exceptions --> new style for Python 3 2019-02-19 13:09:23 +01:00
Michael Youngstrom
3221c2b91f Remove lms pytest shards 2019-02-12 11:03:46 -05:00
Matthew Piatetsky
6e81c84d8b fix unicode strings in lms/ part 1 2019-02-05 15:15:02 -05:00
Ned Batchelder
59d78031d8 Fix trailing-comma-tuple warnings 2018-11-02 11:06:59 -04:00
Jeremy Bowman
4e8668d3be TE-2524 Stop using nose.plugins - LMS 2 2018-08-01 13:54:06 -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
Troy Sankey
b07402e751 remove unused optparse imports 2017-11-09 15:38:54 -05:00
Troy Sankey
150096e3bf courseware management commands cleanup for django 1.11 2017-11-08 15:12:52 -05:00
Andy Armstrong
79acb5c5be Reorder LMS imports using isort 2017-06-11 21:48:06 -04:00
David Ormsbee
2051c90924 Test Speedup: Isolate Modulestore Signals
There are a number of Django Signals that are on the modulestore's
SignalHandler class, such as SignalHandler.course_published. These
signals can trigger very expensive processes to occur, such as course
overview or block structures generation. Most of the time, the test
author doesn't care about these side-effects.

This commit does a few things:

* Converts the signals on SignalHandler to be instances of a new
  SwitchedSignal class, that allows signal sending to be disabled.

* Creates a SignalIsolationMixin helper similar in spirit to the
  CacheIsolationMixin, and adds it to the ModuleStoreIsolationMixin
  (and thus to ModuleStoreTestCase and SharedModuleStoreTestCase).

* Converts our various tests to use this new mechanism. In some cases,
  this means adjusting query counts downwards because they no longer
  have to account for publishing listener actions.

Modulestore generated signals are now muted by default during test runs.
Calls to send() them will result in no-ops. You can choose to enable
specific signals for a given subclass of ModuleStoreTestCase or
SharedModuleStoreTestCase by specifying an ENABLED_SIGNALS class
attribute, like the following example:

    from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase

    class MyPublishTestCase(ModuleStoreTestCase):
        ENABLED_SIGNALS = ['course_published', 'pre_publish']

You should take great care when disabling signals outside of a
ModuleStoreTestCase or SharedModuleStoreTestCase, since they can leak
out into other tests. Be sure to always clean up, and never disable
signals outside of testing. Because signals are essentially process
globals, it can have a lot of unpleasant side-effects if we start
mucking around with them during live requests.

Overall, this change has cut the total test execution time for
edx-platform by a bit over a third, though we still spend a lot in
pre-test setup during our test builds.

[PERF-413]
2017-02-23 10:31:16 -05:00
Adam Palay
da58ad2a2b only dump courses to neo4j if they've been updated since the last time they were dumped
improvements to the command line interface for caching
2016-10-11 08:20:23 -04:00
Adam Palay
01a0f6d6ee allow ability to specify which courses to write to neo4j 2016-10-07 14:22:32 -04:00
Adam Palay
239867963e set neo4j configuration at the command line 2016-09-28 09:08:04 -04:00
David Ormsbee
75f9a522dc Script to remove course_ids with \n from CSM
Some StudentModule entries were written with newlines at the end of the
course_id. This script finds those entries within a given time range,
archive them, and merges records if necessary (capa problems).
2016-09-01 22:28:06 -04:00
Adam Palay
10bd4ef6bf dump item information to neo4j
clear request cache to avoid memory leak

update to use https

delete courses in the same transaction as writing them

python3 compatibility
2016-08-30 14:59:00 -04:00
Calen Pennington
bc20a37c2b Simplify how shards are selected in CI 2016-08-03 16:23:02 -04:00
E. Kolpakov
33b3dfcc92 Converts Discussion XModule to Discussion XBlock
* Renames discussion_module to discussion_xblock
* Moves common/lib/xmodule/xmodule_discussion to openedx/core/lib/xblock_builtin/xblock_discussion
2016-06-29 06:47:04 +12:00
Brian Wilson
a36aa68fd7 Add new export_olx management command.
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.
2016-05-26 17:26:59 -04:00
Adam Palay
bfb319db9a add discussion_id to course structure dump command (AN-6696)
add test case for discussion_id already set in XML
2016-05-09 11:24:37 -04:00
Ned Batchelder
2e1238b83e Remove unused imports 2016-04-08 11:23:05 -04:00
Hassan
48a5b954d5 Use CourseOverview for dump_course_ids 2016-03-07 19:44:38 +05:00
Calen Pennington
dd90c55602 Create a new CSMHExtended table to hold our new data
This is a clone (copy) of CSMH's declaration and methods with an added
id of UnsignedBigInAutoField

We should be able to delete the save_history code, but needs testing.

Add error logging when capa failures happen

Put StudentModuleHistory into its own database

Bump out the primary key on CSMHE

This gives us a gap to backfill as needed.
Since the new table's pk is an unsigned bigint, even for people who don't
consolidate CSMH into CSMHE, the lost rows are unlikely to matter.

Remove StudentModuleHistory cleaner
2016-02-29 13:58:39 -05:00
Sarina Canelake
addbfa75e8 Remove references to deleted ORA1 test course 2015-12-11 15:07:09 -05:00
Sarina Canelake
ade863e994 Remove CMS Course Checklists feature 2015-12-11 10:32:14 -05:00
Nimisha Asthagiri
801165b266 Remove support for outdated ispublic field on Course Descriptor
Also remove its corresponding ACCESS_REQUIRE_STAFF_FOR_COURSE feature
flag.
2015-12-10 20:37:39 -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
Ned Batchelder
2a0259095d Change imports from path to use the stablest name.
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.)
2015-08-27 12:59:25 -04:00
Calen Pennington
6ba611cb5f Remove remove_input_state.py, as it was one-time fix code, and is not worth porting to the new interface 2015-08-01 08:13:25 -04:00
Calen Pennington
aa374ca12a Make DjangoXBlockUserStateClient pass semantic tests
This required the following changes to the DjangoXBlockUserStateClient
semantics:

1) Changes get/get_many to return XBlockUserState tuples, rather
than state dictionaries or (block_key, state) tuples.
2) Raises DoesNotExist if get_history is called on an XBlock that has
had no data saved to it.
3) Returns XBlockUserState tuples as the results of get_history.
2015-08-01 08:13:25 -04:00
Sarina Canelake
39d3537410 Pylint logging-format-interpolation: Convert logging calls to use %s formatting 2015-07-13 17:33:29 -04:00
Ned Batchelder
e6e5a8d812 Convert some try/finally to addCleanup 2015-07-02 19:31:48 -04:00
Calen Pennington
c1ace04483 Merge pull request #8391 from edx/alawibaba/plat5892
First draft.
2015-06-12 12:39:38 -04:00
Ali Mohammad
69772ef20e Convert access to StudentModuleHistory to use the UserStateClient API. 2015-06-12 12:37:34 -04:00
alawibaba
36e5fcf4c9 Make clean_history.py use the StudentHistoryModule django model. 2015-05-29 17:28:01 -04:00
Christine Lytwynec
ddb1ae667e Split lms unittests into multiple shards 2015-05-07 09:17:26 -04:00
Adam
9ad4b71688 Merge pull request #7572 from edx/release
Release
2015-04-02 17:24:50 -04:00
Waheed Ahmed
62a515f038 Fixed static pages removed on import for split course.
PLAT-484
2015-04-02 20:14:46 +05:00