Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
course-discovery
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
course-discovery
Commits
5bc5bb59
Commit
5bc5bb59
authored
Mar 23, 2016
by
Clinton Blackburn
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #39 from edx/clintonb/update-drf-extension
Updated edx-drf-extensions
parents
aa0f2c6b
e3c95865
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
course_discovery/apps/api/v1/tests/test_views.py
+3
-1
requirements/base.txt
+1
-1
No files found.
course_discovery/apps/api/v1/tests/test_views.py
View file @
5bc5bb59
# pylint: disable=redefined-builtin
import
datetime
import
json
import
urllib
from
time
import
time
...
...
@@ -33,11 +34,12 @@ class OAuth2Mixin(object):
def
mock_access_token_response
(
self
,
user
,
status
=
200
):
""" Mock the access token endpoint response of the OAuth2 provider. """
url
=
'{root}/{token}'
.
format
(
root
=
OAUTH2_ACCESS_TOKEN_URL
.
rstrip
(
'/'
),
token
=
self
.
get_access_token
(
user
))
expires
=
datetime
.
datetime
.
utcnow
()
+
datetime
.
timedelta
(
days
=
1
)
responses
.
add
(
responses
.
GET
,
url
,
body
=
json
.
dumps
({
'username'
:
user
.
username
,
'scope'
:
'read'
,
'expires
_in'
:
60
}),
body
=
json
.
dumps
({
'username'
:
user
.
username
,
'scope'
:
'read'
,
'expires
'
:
expires
.
isoformat
()
}),
content_type
=
"application/json"
,
status
=
status
)
...
...
requirements/base.txt
View file @
5bc5bb59
...
...
@@ -5,7 +5,7 @@ djangorestframework==3.3.1
djangorestframework-jwt==1.7.2
django-rest-swagger[reST]==0.3.4
edx-auth-backends==0.1.3
edx-drf-extensions==0.1.
0
edx-drf-extensions==0.1.
1
edx-rest-api-client==1.5.0
elasticsearch>=1.0.0,<2.0.0
pytz==2015.7
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment