Commit Graph

24 Commits

Author SHA1 Message Date
M. Zulqarnain
e505d99237 pyupgrade on lms gating and grades apps (#26532) 2021-02-22 12:58:41 +05:00
Aarif
906b6f7fed replaced unittest assertions pytest assertions (19) (#26545) 2021-02-18 18:00:30 +05:00
M. Zulqarnain
0213fde968 BOM-2281 : Pylint amnesty for grades,gating and instructor app (#26343)
* pyint amnesty for grades,gating and instructor app
2021-02-03 18:14:35 +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
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
Stu Young
22856fdc1a INCR-315 (#20610): python-modernize lms/djangoapps/grades/tests
* run python modernize
* run isort
* fix pylint issues
2019-05-28 11:21:34 -04:00
Michael Youngstrom
3221c2b91f Remove lms pytest shards 2019-02-12 11:03:46 -05:00
Michael Youngstrom
8aed0ff719 Clean up after any get_mock_request or set_current_request calls 2018-08-22 17:23:39 -04:00
Jeremy Bowman
1a5bf35357 TE-2689 Remove useless pylint suppressions part 2 2018-08-14 17:39:02 -04:00
Stuart Young
1fd2167144 rebalance python unittests onto new shards 2018-05-03 11:16:05 -04:00
Nimisha Asthagiri
f8e3a3c461 Grades Cleanup
EDUCATOR-1405
EDUCATOR-1451
2017-10-02 19:03:26 -04:00
Andy Armstrong
79acb5c5be Reorder LMS imports using isort 2017-06-11 21:48:06 -04:00
J. Cliff Dyer
ea0027f338 refactor CAPA to use scorable xblock mixin
for TNL-6594
2017-05-01 15:08:17 -04:00
Nimisha Asthagiri
18433dab95 Refactor Instructor Tasks - in prep for Grade report work 2017-04-24 19:35: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
Eric Fischer
7d82f32f5b Fix issue with test ordering
The second test here is not idempotent, so we must needs reset the
course before each test.
2017-02-17 09:48:56 -05:00
Nimisha Asthagiri
7cc08399c6 Fix mongo query count for Grades API 2017-02-01 17:58:36 -05:00
sanfordstudent
e860205e67 Merge pull request #14191 from edx/beryl/content_library_access
Test retrieving subsection grade after losing access to block in subsection
2016-12-21 13:19:05 -05:00
Nimisha Asthagiri
d1d8d31bba Test retrieving subsection grade after losing access to block in subsection 2016-12-21 11:49:33 -05:00
Sanford Student
ac9b8fba5e context manager for course id in context 2016-12-20 15:26:05 -05:00
Eric Fischer
5a98a90eba Use timestamps in _has_database_updated_with_new_score check
Also fixes issue where ORA grades were never updated, by including
them in this check.

TNL-5994
TNL-5995
2016-12-09 13:46:34 -05:00
Sanford Student
5f2ffbe75b implementation of grading events
for TNL-5045
2016-12-07 14:47:08 -05:00