-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BB-2132] [YONK-1560] Support JWT creation on openedx ironwood (#27)
* Support JWT creation on openedx ironwood Problem root cause: JwtBuilder class was removed in commit dc56a63e of edx-platform git repository and the eoc-journal xblock was not updated accordingly. This patch drops support of all openedx versions before ironwood. * Set pdfminer version in Python requirements for test environment pdfminer 20140328 is the last version to support Python 2, used by EDX platform. Due to this, pdfminer newer versions (20091010 and later) were breaking the tests. * Fix tests broken by openedx import An import of Python package openedx was added in commit 4507e0d, but the test environment does not have that Python package. To avoid breaking the tests, this patch: - ignores the import error in Pylint check. - move the import to inside the function, which is not called in tests because the methods which call it are already mocked * Create a Python module which contains edx-platform dependent code * Version bump
- Loading branch information
Showing
4 changed files
with
19 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
""" | ||
edx-platform dependent code | ||
""" | ||
# pylint: disable=import-error | ||
|
||
|
||
def create_jwt_for_user(user): | ||
""" | ||
Wraps openedx.core.djangoapps.oauth_dispatch.jwt.create_jwt_for_user() call | ||
""" | ||
# test env does not have edx-platform installed. because of this, all edx-platform imports must be | ||
# kept inside this function so that the test code does not break when importing the module | ||
from openedx.core.djangoapps.oauth_dispatch.jwt import create_jwt_for_user as openedx_create_jwt_for_user | ||
return openedx_create_jwt_for_user(user) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ fs | |
lxml | ||
mako | ||
markupsafe | ||
pdfminer | ||
pdfminer==20140328 | ||
pycodestyle | ||
pylint | ||
python-dateutil | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters