Commit Graph

254 Commits

Author SHA1 Message Date
Usama Sadiq
2adf8b759e refactor: ran pyupgrade on lms/djangoapps/commerce (#26734) 2021-03-09 14:21:08 +05:00
Jawayria
b3b0b083d2 BOM-2352: Removed unused imports from lms/djangoapps/{certificates, commerce, course_api} 2021-02-23 19:38:25 +05:00
Aarif
a332aac1f6 replaced unittest assertions pytest assertions (#26541) 2021-02-19 12:27:11 +05:00
Jawayria
4b4fc89693 Applied pylint-amnesty to commerce 2021-02-01 18:56:15 +05:00
Dillon Dumesnil
e17e691d54 AA-501: Use hidden blocks to determine past due status
Blocks that were hidden by access checks would not be used when
calculating past due status for a unit. This adds in a check to
still look at those blocks, but will maintain not rendering them
when being accessed via the MFE
2021-01-06 14:11:03 +00:00
Awais Qureshi
0423434132 Fixing test failure. 2020-12-31 15:11:00 +05:00
Saleem Latif
54f59bc3b4 Revert migration update as it creates more issues than it fixes. 2020-11-19 11:25:16 +05:00
Saleem Latif
c0de670c5b Fix sandboax builds, because of signal chains, UserProfile table must be predent before adding a User 2020-11-18 12:55:40 +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
Simon Chen
a900cec9e7 MST-338 Update other outstanding links to old IDV into new IDV flow (#25526) 2020-11-05 20:43:24 -05:00
Jeremy Bowman
d19368525b DEPR-43 Remove most of the shoppingcart app (#24692)
Removed most of the deprecated shoppingcart app, leaving just enough to allow us to cleanly remove the related database tables later. Also removed the relevant Django settings that weren't in use elsewhere.
2020-10-14 14:24:52 -04:00
Nimisha Asthagiri
5b3f5ee85a commerce app: remove code related to shoppingcart (#23974)
Part of DEPR-43 - https://openedx.atlassian.net/browse/DEPR-43

Co-authored-by: Jeremy Bowman <jbowman@edx.org>
2020-05-28 09:46:12 -04:00
mariajgrimaldi
6eead791a1 Fix DeprecationWarning: Please use assertNotRegex instead (#23907)
I wanted to make a byte-sized contribution but there were no Jira tickets so we decided, thanks to a conversation with @jmbowman through the Open Edx Community #incr (Slack) channel, to collaborate in the elimination of warnings listed in the Warnings Report at https://build.testeng.edx.org/job/edx-platform-python-pipeline-master/warning_5freport_5fall_2ehtml/

This PR contributes to the elimination of deprecation warnings, specifically the one mentioned above and reported in the Warnings Report.

Changed assertNotRegexpMatches to assertNotRegex in the following files:

    cms/djangoapps/contentstore/views/tests/test_preview.py

    cms/djangoapps/contentstore/views/tests/test_item.py

    lms/djangoapps/commerce/tests/test_views.py

    lms/djangoapps/dashboard/tests/test_sysadmin.py

This warning occurs due to deprecation in python 3.5: https://docs.python.org/3.5/library/unittest.html#unittest.TestCase.assertNotRegex
2020-05-08 11:53:02 -04:00
Aarif
98af9ce418 remove useless-supression warnings 2020-05-01 19:42:15 +05:00
Robert Raposa
5de9eed420 ARCHBOM-1093: Fix unit test enable-migrations (#23789)
* fix old migrations
* fix a test
* fix enable-migrations cmd argument
* enhance verbose logging to log migrations
* update testing doc with help
2020-04-23 14:04:29 -04:00
HammadAhmadWaqas
c09b382e52 fixing flakiness of tests due to redundant id created by faker. 2020-04-03 12:50:47 +05:00
Jeremy Bowman
9ef0aa4880 Downgrade to pytest-django 3.8.0 for now (#23566)
We'll upgrade this again along with pytest once pytest-dev/pytest#6925 is resolved.

Also, it looks like a flaky error in test class DB setup outside a transaction was mucking things up for the rest of the test shard. I didn't try to fix the flakiness, but this should at least limit the blast radius to just that test class. We really need to start using setUpTestData() more consistently.
2020-04-01 14:17:27 -04:00
Awais Qureshi
30a2ae8aec BOM-1438
Fix course_id string.
2020-04-01 14:42:35 +05:00
HammadAhmadWaqas
48d9c82e0a added sleep of 1 second in create_orders_for_old_enterprise_course_enrollment command so that we should not hit ecommerce API more that 60 calls per minute. 2020-03-24 15:50:14 +05:00
HammadAhmadWaqas
968761e7f9 better exception handling 2020-03-17 15:55:36 +05:00
HammadAhmadWaqas
62e791f8b0 printing only id for failed enterprise course enrollment.
also setting query batch size 1000 instead of 5000
2020-03-16 19:07:55 +05:00
HammadAhmadWaqas
b99977a3cb added management command to push old enrollments to ecommerce 2020-02-26 17:41:05 +05:00
Manjinder Singh
d7bd80a100 Renamed OAuth2Authentication to BearerAuthentication (#23128)
* Renamed OAuth2Authentication to BearerAuthentication
* Added back OAuth2Authentication name
-there are libraries such as edx-enterprise that still import OAuth2Authentication.  The OAuth2Authentication class should be fully removed when everything is importing BearerAuthentication correctly
2020-02-18 13:29:29 -05:00
Manjinder Singh
cce8cdd661 Replacing OAuth2Auth (#23067)
- Removing deprecated auth classes
- Replacing OAuth2AuthenticationAllowInactiveUserDeprecated with OAuth2AuthenticationAllowInactiveUser
- the old class was a child class of a deprecated class that we are removing and replacing.
2020-02-11 10:38:13 -05:00
Manjinder Singh
cea795b02e Added new auth class (#23018)
* Added new auth class

- Created new class called OAuth2AuthenticationAllowInactiveUser, which replaces old class with same name
- Renames previous  OAuth2AuthenticationAllowInactiveUser to  OAuth2AuthenticationAllowInactiveUserDeprecated
- Replaced all imports of  OAuth2AuthenticationAllowInactiveUser to call deprecated class instead
- testing new class in discussion(added flag based on django setting)
2020-02-06 10:37:27 -05:00
Calen Pennington
4901dde748 Clean up pylint errors to get diff-quality to pass 2020-02-06 09:18:30 -05:00
Manjinder Singh
eb694528e7 Adding metrics to oauth2authentication class (#22970)
Currently, we are working on removing the rest_framework_auth library from edx-platform. For this push, we need to remove the oauth2Authentication class. This PR creates a new class oauth2AuthenticationDeprecated that adds additional new relic metrics. The metrics would allow us to see how often this class is used and its success rate. The hope is that this information will help us with transitioning to a different authentication class.
2020-01-30 09:13:51 -05:00
Feanil Patel
046feb0cf0 Merge pull request #22649 from edx/feanil/fix_pep8
Fix all E303 pep8 errors.
2019-12-30 13:32:26 -05:00
Feanil Patel
6e3fe00fff Fix all E303 pep8 errors. 2019-12-30 12:25:38 -05:00
Feanil Patel
2df8b8226b Merge pull request #22643 from edx/feanil/2to3_asserts
Run `2to3 -f asserts . -w` on edx-platform.
2019-12-30 12:13:42 -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
70294b0ad2 Run 2to3 -f asserts . -w on edx-platform.
https://docs.python.org/3.5/library/2to3.html#2to3fixer-asserts
2019-12-30 10:22:19 -05:00
Matt Tuchfarber
865114cba6 Add data migration to fix ecommerce_worker email
ecommerce_worker is the only service user with a @fake.email  instead of
an @example.com email address. This was fixed manually in a devstack sql
dump, but was lost during the next sql dump. This will fix it moving
forward so we don't have to work around it.
2019-10-29 14:04:29 -04:00
Manjinder Singh
80c7f5af01 BOM-933: Fix type mismatches in various migrations 5 (#22147)
* fix type mismatch in third_party_auth migrations

* fix type mismatch in verify_student  migrations

* fix type mismatch in video_config  migrations

* fix type mismatch in verified_track_content  migrations

* fix type mismatch in commercemigrations

* fix type mismatch in xblock_config migrations

* fix type mismatch in course_creators migrations

* fix type mismatch in contentstore migrations
2019-10-24 16:08:04 -04: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
5c47a3b425 BOM Project
Updated __unicode__ to __str__
2019-09-25 18:31:54 +05:00
Feanil Patel
844acea50e Fix linting errors. 2019-09-19 17:05:02 -04:00
Feanil Patel
802929fde4 BOM-622 Type errors in content matching. 2019-09-19 16:18:23 -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
Dave St.Germain
5febcce20c Fix python3 compatibility in SafeCookieData and elsewhere 2019-08-19 10:24:15 -04:00
Ayub khan
2244540ade BOM-78
Update uuid4().hex.decode(ascii) calls
2019-08-06 17:16:08 +05:00
Kyle McCormick
9f9a07db4f Stop the commerce API from deleting Masters course modes. 2019-07-30 11:18:23 -04:00
Christie Rice
fee8e17f95 REVMI-341 Stop sending lms_client_id in jwt sent to ecommerce (#21167) 2019-07-19 10:46:46 -04:00
Ayub khan
99060623ac INCR-442 python3 compatibility 2019-07-19 09:53:01 -04:00
arbisoft
91aac28ca7 Fixing python-modernize issues. 2019-07-16 13:16:03 +05:00
uzairr
3f6e014f7e Python-modernize on edx-platform (338 of 380)
After executing python-modernize and isort, few changes
occurred in import sequence as well as unicode func is
replaced by six.text_type func.

INCR-441
2019-07-12 13:30:39 +05:00
Christie Rice
3415824451 REVMI-280 Add course name and announcement to message (#20895) 2019-06-26 09:23:33 -04:00
Ned Batchelder
b3a731550c Fix problems that drf-yasg uncovered.
These were originally fixed individually, but had to be reverted, and
are now combined in one commit.  The originals were:

7b9040f6b0 This enum was backwards
8774ff1f9b Use ref_name to disambiguate serializers that drf-yasg would otherwise assume are the same.
8a44397139 Is this field missing because it is None?
4a1154a7ca Give a safer buffer for clearing the rate limiting
64c47856dd DRF 3.7.4 changed how you delegate to another view, so don't
7359ca4fb2 Is this right? It fixes two tests
fdd66e5390 Adjust the expected error message for DRF 3.7.7
9257f68fd8 The default TIME_ZONE should be UTC
2019-06-21 18:04:15 -04:00
Diana Huang
58a363e9d4 Remove microsites from commerce and theming. 2019-06-14 15:20:50 -04:00
Ned Batchelder
39c7a2db7c Revert "Use drf-yasg for Open API documentation" 2019-06-11 16:05:00 -04:00