Commit Graph

61 Commits

Author SHA1 Message Date
Jawayria
707f940770 Refactor: Removed unused imports
Removed unused imports from lms/djangoapps/{course_wiki, coursewarehistoryextended, discussion}
2021-04-07 12:54:21 +05:00
Usman Khalid
dd96a2aa72 Convert Course, Section and Sequence XModules to XBlocks. (#25965) 2021-03-02 10:29:33 -05:00
edX requirements bot
f33f12bbea BOM-2358 : Pyupgrade in dashboard, debug, discussion apps (#26529)
* Python code cleanup by the cleanup-python-code Jenkins job.

This pull request was generated by the cleanup-python-code Jenkins job, which ran
```
cd lms/djangoapps/dashboard; find . -type f -name '*.py' | while read fname; do sed -i 's/  # lint-amnesty, pylint: disable=super-with-arguments//; s/  # lint-amnesty, pylint: disable=import-error, wrong-import-order//; s/  # lint-amnesty, pylint: disable=wrong-import-order//' "$fname"; done; find . -type f -name '*.py' | while read fname; do pyupgrade --exit-zero-even-if-changed --py3-plus --py36-plus --py38-plus "$fname"; done; isort --recursive .
```

The following packages were installed:
`pyupgrade,isort`

* feedback done

Co-authored-by: Zulqarnain <muhammad.zulqarnain@arbisoft.com>
2021-02-22 15:42:21 +05:00
Aarif
a8b9733654 replaced unittest assertions pytest assertions (#26544) 2021-02-19 11:59:44 +05:00
M. Zulqarnain
65cf0db337 BOM-2278 : Pylint amnesty in discussion, dashboard (#26275)
* pylint amnesty in discussion, dashboard
2021-02-03 18:15:14 +05:00
usamasadiq
dbfec8ee3c Remove nonrequired conditions 2021-02-01 16:30:47 +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
sarina
f414fad0cc Change gendered language to gender-neutral 'they/them/their' 2020-11-02 18:23:13 -05:00
Saleem Latif
43d0a67fa1 Request for field to specify locale in Django enterprise accounts 2020-10-20 17:56:22 +05:00
Michael Terry
3030efec78 AA-177: Add masquerading for course home MFE
- Looks at masquerading config for dates, outline, metadata, and
  celebration APIs in course_home_api / courseware_api.
- Consolidates and cleans up places we check whether masquerading
  gives us full access to a course.
2020-06-29 12:37:47 -04:00
Eric Herrera
bf945e2aec Separate tests according to the python version, due to incompatibilities in sorted dicts. 2020-06-25 11:35:21 -04:00
Aarif
98af9ce418 remove useless-supression warnings 2020-05-01 19:42:15 +05:00
Muhammad Soban Javed
fefb940744 Merge pull request #23634 from edx/BOM-1495
BOM-1495: Django 2.0: fails on comparing nested lists.
2020-04-07 16:41:10 +05:00
Soban Javed
0ff96e7e25 fixed failures of test due to ordering issue in dict 2020-04-06 20:49:00 +05:00
Usama Sadiq
baabbc5ffb Merge pull request #23625 from edx/usamasadiq/bom-1496
Django2.2 Post request update
2020-04-06 17:40:16 +05:00
usamasadiq
32a8c33055 Django2.2 Post request update 2020-04-06 16:10:26 +05:00
Awais Jibran
934e58fb54 Fixes NoReverseMatch exception.
`django.urls.exceptions:NoReverseMatch lms.djangoapps.discussion.tasks.send_ace_message`
PROD-1224
2020-04-06 13:41:54 +05:00
Awais Jibran
65094cbf35 Handle deprecation warn by importing right class.
2900k/ last 7 days
2020-03-13 21:50:40 +05:00
Awais Jibran
c547af074f Remove unessary logs 2020-03-06 12:16:03 +05:00
Aarif
97d327feeb BOM-1121
Old style mixin compatibility with django2.2
2020-01-30 16:36:02 +05:00
Dave St.Germain
1aa8c9c53d Add a new courseware API Django app to support the courseware micro-frontend. 2020-01-28 14:59:07 -05:00
Jansen Kantor
25baa93af9 EDUCATOR-4877: Implement stubbed API functions using new config values (#22913)
add stubbed api functions, tests
2020-01-24 15:54:32 -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
Matthew Piatetsky
8e54125e96 Merge pull request #22223 from edx/REV-693-step3
[REV-693] Delete old holdback code
2019-11-07 14:12:05 -05:00
Matthew Piatetsky
bd76a71019 delete old holdback code 2019-11-07 09:51:39 -05:00
Kyle McCormick
4f3262a40b Remove most references to old teams config scheme (#22238)
This is a follow up from MST-16, which was commited
in 3858036a4e.

Changes:
* Enrich course teams_configuration from a plain Dict
  to a custom XBlock field that uses the new TeamsConfig
  wrapper class.
* Remove teams_conf property from course, as the previous
  change made it redundant.
* Update teams_enabled implementation.
* Remove teams_max_size field from course, which is
  no longer semantically correct, as max team size
  is now defined on a teamset level.
* Remove teams_topics in order to discourage use of raw
  teams config dict.
* Add convenience properties teamsets and teamsets_by_id
  to course.
* Allow periods and spaces in teamset IDs to avoid breaking
  existing course teams.

Some parts of the code still use the old raw config data
(identifiable by searching "cleaned_data_old_format"),
which we expect to be slowly factored away as we build
new teams features. MST-40 has been created to remove any
remaining references if necessary.

MST-18

* fix: bokchoy test

* fix: remove pdb break
2019-11-06 20:43:32 -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
22c6d45d90 BOM-679
Request object was mocked but mocked value was never assigned.
In py2 moked object call is always successful. But in py3 if
value is not properly assigned it returns None. Causing the test
to fail. Removing the mocked object also fails the test so
removing it as broken test.
2019-09-25 14:47:28 +05:00
Feanil Patel
de0eafa0ba BOM-618 Decode test client content.
The django test client returns bytes, and many of our tests start using
it like a string. This was fine in python 2 but not in python3.
2019-09-18 14:58:30 -04:00
Ayub khan
06c7e3e4e9 BOM-420
fixed all file tests
2019-09-13 18:39:00 +05:00
Ayub
82bddf12ab Merge pull request #21578 from edx/BOM-106
BOM-106
2019-09-11 16:44:27 +05:00
Ayub khan
8f65e6923b BOM-106
python3 compatibility
2019-09-11 16:03:58 +05:00
Ayub khan
26d9866bb2 BOM-123
Removed broken tests.
2019-09-11 14:24:59 +05:00
arbisoft
1f78305f99  This is a combination of 2 commits.
 This is the 1st commit message:

BOM-149
python3 tests failures.

 This is the commit message #2:

BOM-149
python3 tests failures.
2019-09-05 12:49:06 +05:00
Ayub khan
09beb2c72e BOM-227
python3 compatibility
2019-09-04 14:36:06 +05:00
Ayub
85be57b64a Merge pull request #21397 from edx/BOM-95
BOM-95
2019-08-22 12:41:08 +05:00
Feanil Patel
f332b81e4c Merge pull request #21384 from edx/bom/python-3-swarm
Bom/python 3 swarm
2019-08-21 09:27:59 -04:00
Ayub khan
8a95a8e520 BOM-95
assertItemsEqual with six.assertCountEqual
2019-08-21 17:01:40 +05:00
Bill DeRusha
aebdf77f8e Revert "PROD-145: Added validation to discussion topic input in studio, testing 2" 2019-08-20 20:31:15 -04:00
Feanil Patel
73a146fbbe Revert "assertItemsEqual() moved to assertCountEqual()"
This reverts commit 3d2617983b.

The change was not quite right because the method six provides needs to
have `self` be passed in as well.  See the docs here:
https://six.readthedocs.io/#unittest-assertions

Reverting for now and we can fix it in smaller chunks later.
2019-08-20 15:31:20 -04:00
Dave St.Germain
3d2617983b assertItemsEqual() moved to assertCountEqual() 2019-08-19 17:00:17 -04:00
Dave St.Germain
8e725c9eee Prevent comparison to None 2019-08-19 16:21:28 -04: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
jinder1s
e7fb13a74f Added validation to discussion topic input in studio 2019-08-15 16:13:37 -04:00
Feanil Patel
d9c9d7bab9 Deal with NoneType access.
The `NoneType` object is not available from the `types` module in
python 3. This is a workaronud to deal with that.
2019-07-19 09:48:10 -04:00
usama sadiq
1630911131 Updated to Python3
Added absolute import in both files
2019-06-20 16:07:17 +05:00
amitvadhel
94f410f432 INCR-477: Make compatible with Python 3.x 2019-06-19 08:35:43 +03:00
Jeremy Bowman
f9929f32b5 Update quality threshold counts (#20681) 2019-05-24 08:27:54 -04:00