Commit Graph

22 Commits

Author SHA1 Message Date
M. Zulqarnain
ba75bb6569 feat: django codemods changes for common folder (#28775) 2021-10-21 13:52:19 +05:00
Feanil Patel
4f9fe59731 test: Fix date tests that rely on user preference.
The function under test by the StrftimeLocalizedHtmlTest checks the
timezone in the user preferences of the user making the request.  If we
don't explicitly set a request here, it will simply use the last Request
that `crum` cached in the thread local cache.  This broke now
that we sometimes set the crum request.user to an invalid user in other
tests.

This change ensures that we have a valid request for these tests as a
part of the setup of this test class.
2021-03-25 13:18:07 -04:00
M. Zulqarnain
42eacaf8de refactor: pyupgrade in common/util + xblock_django (#26724) 2021-03-09 16:49:51 +05:00
Aarif
a1406cddf2 replaced unittest assertions pytest assertions (#26528) 2021-02-18 18:09:45 +05:00
Jawayria
b1ecfc2252 Applied pylint-amnesty to util 2021-02-02 14:59:19 +05:00
Michael Terry
1482755bbd Show discount deadline in a timezone-aware way
Also, fix it and the access expiration deadline to not hardcode
the date presentation in an American way.
2021-01-08 13:56:18 -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
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
aarif
76706553bf python 3 fixes
test fixes
2019-09-16 17:19:18 +05:00
Jolyon Bloomfield
8adaca66d1 INCR-200 Migrate common/djangoapps/util/tests and migrations 2019-04-05 00:57:46 -04:00
cclauss
44d62fac75 Fix explicit tuple parameters for Python 3 2019-02-19 12:37:34 +01:00
Jeremy Bowman
bcaec3c5bb TE-2525 nose.tools removal part 1/2 2018-08-07 08:30:12 -04:00
Andy Armstrong
93235d118d Reorder imports using isort (except lms and cms) 2017-05-30 16:04:54 -04:00
Kevin Kim
0bf8fc4b44 Converts the dates on the dashboard, sidebar navigation, and important course dates to user specified time zone. 2016-07-05 17:45:13 +00:00
Saleem Latif
05a72486f3 date format "Monday at 3pm UTC" added for courses starting with-in 5 days 2015-09-23 12:17:08 +05:00
Sarina Canelake
0c7b60b82b Remove 'pylint: disable=W0232' because we ignore this warning in pylintrc 2014-12-01 11:22:12 -05:00
Sarina Canelake
20e2ee9a57 s/pylint: disable=E0611/pylint: disable=no-name-in-module/ 2014-12-01 11:22:09 -05:00
Ned Batchelder
b21473f976 Make fake_ugettext et al more usable elsewhere. 2014-02-24 10:06:13 -05:00
Ned Batchelder
66e598b75d Add strftime_localized function, not called yet. 2014-02-18 17:35:56 -05:00
Ned Batchelder
229f3522fa Move date_utils to common/djangoapps/util 2014-02-18 17:35:56 -05:00