Commit Graph

73 Commits

Author SHA1 Message Date
Sarina Canelake
4a2f231302 fix: fix github url strings (org edx -> openedx) 2022-09-15 14:52:28 -04:00
Michael Terry
afd19f0513 feat!: drop legacy courseware tab access for learners
The only way to access the legacy courseware is now through the
Studio preview feature (and at some point, when the MFE supports a
preview mode, we can then remove even that).

This drops the courseware.use_legacy_frontend waffle.
2022-04-19 12:27:10 -04:00
Michael Terry
b905de757b test: more Old Mongo removal from tests
Convert more tests from MONGO_AMNESTY to SPLIT modulestores.

This is in preparation for just wholesale denying access to Old
Mongo, so I either converted tests to split or just deleted some
test variants that were Old Mongo specific. (e.g. ddt lines)
2022-02-11 14:50:30 -05:00
Michael Terry
cb1bb7fa64 test: switch default test store to the split store
It's long past time that the default test modulestore was Split,
instead of Old Mongo. This commit switches the default store and
fixes some tests that now fail:
- Tests that didn't expect MFE to be enabled (because we don't
  enable MFE for Old Mongo) - opt out of MFE for those
- Tests that hardcoded old key string formats
- Lots of other random little differences

In many places, I didn't spend much time trying to figure out how to
properly fix the test, and instead just set the modulestore to Old
Mongo.

For those tests that I didn't spend time investigating, I've set
the modulestore to TEST_DATA_MONGO_AMNESTY_MODULESTORE - search for
that string to find further work.
2022-02-04 14:32:50 -05:00
Jawayria
4347c35072 chore: Applied lint-amnesty on openedx/tests 2021-12-06 14:01:53 +05:00
stvn
5dd8302d8b refactor: Move GlobalStaffFactory helper to common/ 2021-04-14 07:26:39 -07:00
Usama Sadiq
6a79d47589 refactor: Ran pyupgrade on openedx/{testing, tests} 2021-04-08 14:49:40 +05:00
Aarif
b58ea1f03c replaced unittest assertions pytest assertions (#26576) 2021-02-22 16:18:51 +05:00
Awais Qureshi
7321e9e5eb BOM-2338
Apply pylint-amnesty.
2021-02-08 17:42:01 +05:00
Leonardo Martinez
b4fee68283 Fix the DeprecationWarning for unescape (#23936)
This PR solves the DeprecationWarning mentioned in:
https://build.testeng.edx.org/job/edx-platform-python-pipeline-master/warning_5freport_5fall_2ehtml/

HTMLParser was renamed in html.parser in Python3:
https://docs.python.org/2/library/htmlparser.html#module-HTMLParser

* html_parser.HTMLParser().unescape from six.moves has been deprecated

* instead use html.unescape from Python3

Documentation for unescape in Python3:
https://docs.python.org/3/library/html.html#html.unescape

- html_parser from six.moves has been deprecated

- instead use html.parser from Python3

- Order imports using isort

- Delete unused import crum
2020-06-19 09:27:45 -04:00
Daniel Francis
82c0ca0da8 Fixing implicit parser name for Beautiful Soup (lms, openedx) (#24100)
Fixing 56 GuessedAtParserWarnings, in commit edx#24098

Background: BeautifulSoup automatically picks the fastest parser available. By default, it picks the "lxml" parser.

Per the [BeautifulSoup](https://www.crummy.com/software/BeautifulSoup/bs4/doc/#installing-a-parser) documentation:

> Beautiful Soup supports the HTML parser included in Python’s standard library, but it also supports a number of third-party Python parsers. One is the lxml parser. Depending on your setup, you might install lxml with one of these commands.
> Another alternative is the pure-Python html5lib parser, which parses HTML the way a web browser does. 

Context: We changed two statements, one in lms and another in openedx. Both statements fire up BeautifulSoup. Now we explicitly ask for "lxml," following the recommendation on BeautifulSoup's documentation:

> If you can, I recommend you install and use lxml for speed. If you’re using a very old version of Python – earlier than 2.7.3 or 3.2.2 – it’s essential that you install lxml or html5lib. Python’s built-in HTML parser is just not very good in those old versions.

Before:
`soup = BeautifulSoup(content)`

After:
`soup = BeautifulSoup(markup=content, features="lxml")`

The warnings are gone, tests are passing in local.
2020-06-18 15:41:07 -04:00
Aarif
6ee2089077 fixed warnings for wrong-import-order 2020-04-08 23:43:06 +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
Ayub
f08a7e7268 Merge pull request #22032 from edx/BOM-xblock-recommender-tests-fix
BOM Project Xblock Recommber integration tests fix
2019-10-15 13:03:40 +05:00
Awais Qureshi
f7adc71c44 BOM-924
Fixing TypeError, the JSON object must be str, not 'bytes'.
2019-10-15 12:11:24 +05:00
Ayub khan
f0133d861d BOM Project Xblock Recommber integration tests fix
Python3 json can not work with bytes type input so used simplejson
instead of python json which works with both bytes and unicode
type input.
Previously we mistakenly updated StringIO to six.String io. which
caused the tests failure. Used io.BytesIO to fix the issues as
assci character bytes can not be converted to unicode.
2019-10-14 18:20:42 +05:00
asadazam93
7a43721f81 Upgrade python 3 decode error 2019-10-04 16:17:11 +05: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
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
Jeremy Bowman
ff7292538e More pylint fixes (#20692) 2019-05-28 09:19:31 -04:00
aliciaerwin
ddeb7c4204 INCR-237 Run python modernize on openedx/tests (#20494) 2019-05-24 15:46:18 -04:00
Michael Youngstrom
4bbd1dee0b Remove shards from commonlib-unit tests 2019-02-12 14:28:35 -05:00
Dillon Dumesnil
dbd85410f8 Removing test file for removed review xblock 2019-01-31 10:19:54 -05:00
cclauss
8fca11b85c Use print() function in both Python 2 and Python 3 2019-01-13 17:16:37 +01:00
Farhanah Sheets
5c3c0f0fcb Edit test value to be valid URL format 2018-09-10 20:21:56 -04:00
Jeremy Bowman
3ff3eee2f2 TE-2689 Remove useless pylint suppressions part 4 2018-08-20 12:54:22 -04:00
Jeremy Bowman
c290bf8a07 TE-2524 Stop using nose.plugins - openedx 2018-08-02 14:54:50 -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
Jeremy Bowman
113e8dde61 PLAT-1885 Stop using deprecated BlockUsageLocator properties 2018-01-12 16:40:21 -05:00
Jeremy Bowman
d3d6272d8f PLAT-1873 to_deprecated_string() cleanup part 1 2018-01-08 13:51:42 -05:00
Dillon Dumesnil
a03ce146a0 Removing debugging 2017-12-08 15:35:29 -05:00
Dillon Dumesnil
aa8b7ab2ec Fixing correctness text so it doesn't match 'correct' in the word 'correctness' causing my tests to fail. This should be improved soon 2017-12-08 13:34:44 -05:00
Jeremy Bowman
103c723c6d PLAT-1801 Preserve new user login behavior under Django 1.10+ 2017-12-05 10:20:25 -05:00
Dillon Dumesnil
5afc6c6621 Updating version number after responding to Nimisha's comments in edx/xblock-review and updated header text in xblock 2017-11-30 12:00:04 -05:00
Dillon Dumesnil
7b08890f00 Responding to round 3 comments. Created global variable for the url beginning 2017-11-30 12:00:04 -05:00
Dillon Dumesnil
f5944c2e61 Improving performance of tests by creating everything but the review section prior to running tests and then creating the review section, unit, and XBlock with each test 2017-11-30 12:00:04 -05:00
Dillon Dumesnil
2a68f9b171 Improved tests(exclamation point) 2017-11-30 12:00:04 -05:00
Dillon Dumesnil
70fff66e42 Responding to comments 2017-11-30 12:00:04 -05:00
Dillon Dumesnil
a3a0459de9 Switched to using unittest.skip for failing unneeded test 2017-11-30 12:00:04 -05:00
Dillon Dumesnil
5c2caeff16 Quality fixes 2017-11-30 12:00:04 -05:00
Dillon Dumesnil
a95d26ca94 Tests(exclamation point) 2017-11-30 12:00:04 -05:00
bmedx
5fbbf4979a Tag LMS Unit 1 tests that fail in Django 1.11 2017-11-22 15:46:45 -05:00
Andy Armstrong
93235d118d Reorder imports using isort (except lms and cms) 2017-05-30 16:04:54 -04:00
Ned Batchelder
4a568476fd Remove a number of unneeded super()-delegation methods 2017-04-27 14:12:56 -04:00
Andy Armstrong
da1ac4664e Implement common redirect logic for all course tabs
LEARNER-76
2017-04-12 16:05:32 -04: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
Nimisha Asthagiri
aa000c1a3d Support for rescoring a problem only if the new score is higher
TNL-5046
2016-10-20 15:08:54 -04:00
Nimisha Asthagiri
15d9883f76 Create core/url_utils.py, moving utilities from lms_xblock/runtime 2016-10-06 21:59:11 -04:00