Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-rest-framework
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
django-rest-framework
Commits
73597a16
Commit
73597a16
authored
Apr 28, 2014
by
Max Peterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better Python < 3 compatibility.
parent
170fa10a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
8 deletions
+2
-8
rest_framework/tests/test_authentication.py
+2
-8
No files found.
rest_framework/tests/test_authentication.py
View file @
73597a16
...
...
@@ -19,7 +19,7 @@ from rest_framework.authentication import (
OAuth2Authentication
)
from
rest_framework.authtoken.models
import
Token
from
rest_framework.compat
import
patterns
,
url
,
include
from
rest_framework.compat
import
patterns
,
url
,
include
,
six
from
rest_framework.compat
import
oauth2_provider
,
oauth2_provider_scope
from
rest_framework.compat
import
oauth
,
oauth_provider
from
rest_framework.test
import
APIRequestFactory
,
APIClient
...
...
@@ -199,13 +199,7 @@ class TokenAuthTests(TestCase):
"""Ensure generate_key returns a string"""
token
=
Token
()
key
=
token
.
generate_key
()
try
:
# added in Python < 3
base
=
unicode
except
NameError
:
# added in Python >= 3
base
=
str
self
.
assertTrue
(
isinstance
(
key
,
base
))
self
.
assertTrue
(
isinstance
(
key
,
six
.
string_types
))
def
test_token_login_json
(
self
):
"""Ensure token login view using JSON POST works."""
...
...
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