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
401ab542
Commit
401ab542
authored
Jan 12, 2017
by
Artem Muterko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor schemas tests style
parent
8fcb8d63
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
tests/test_schemas.py
+7
-7
No files found.
tests/test_schemas.py
View file @
401ab542
...
...
@@ -90,7 +90,7 @@ class TestRouterGeneratedSchema(TestCase):
def
test_anonymous_request
(
self
):
client
=
APIClient
()
response
=
client
.
get
(
'/'
,
HTTP_ACCEPT
=
'application/coreapi+json'
)
self
.
assertEqual
(
response
.
status_code
,
200
)
assert
response
.
status_code
==
200
expected
=
coreapi
.
Document
(
url
=
''
,
title
=
'Example API'
,
...
...
@@ -125,13 +125,13 @@ class TestRouterGeneratedSchema(TestCase):
}
}
)
self
.
assertEqual
(
response
.
data
,
expected
)
assert
response
.
data
==
expected
def
test_authenticated_request
(
self
):
client
=
APIClient
()
client
.
force_authenticate
(
MockUser
())
response
=
client
.
get
(
'/'
,
HTTP_ACCEPT
=
'application/coreapi+json'
)
self
.
assertEqual
(
response
.
status_code
,
200
)
assert
response
.
status_code
==
200
expected
=
coreapi
.
Document
(
url
=
''
,
title
=
'Example API'
,
...
...
@@ -217,7 +217,7 @@ class TestRouterGeneratedSchema(TestCase):
}
}
)
self
.
assertEqual
(
response
.
data
,
expected
)
assert
response
.
data
==
expected
class
DenyAllUsingHttp404
(
permissions
.
BasePermission
):
...
...
@@ -312,7 +312,7 @@ class TestSchemaGenerator(TestCase):
}
}
)
self
.
assertEqual
(
schema
,
expected
)
assert
schema
==
expected
@unittest.skipUnless
(
coreapi
,
'coreapi is not installed'
)
...
...
@@ -365,7 +365,7 @@ class TestSchemaGeneratorNotAtRoot(TestCase):
}
}
)
self
.
assertEqual
(
schema
,
expected
)
assert
schema
==
expected
@unittest.skipUnless
(
coreapi
,
'coreapi is not installed'
)
...
...
@@ -400,7 +400,7 @@ class TestSchemaGeneratorWithRestrictedViewSets(TestCase):
},
}
)
self
.
assertEqual
(
schema
,
expected
)
assert
schema
==
expected
@unittest.skipUnless
(
coreapi
,
'coreapi is not installed'
)
...
...
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