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
99d57df9
Commit
99d57df9
authored
Jan 08, 2017
by
Artem Muterko
Committed by
Tom Christie
Jan 08, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert encoders tests to pytest style (#4796)
parent
4dd71d68
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
tests/test_encoders.py
+4
-3
No files found.
tests/test_encoders.py
View file @
99d57df9
...
@@ -2,6 +2,7 @@ from datetime import date, datetime, timedelta, tzinfo
...
@@ -2,6 +2,7 @@ from datetime import date, datetime, timedelta, tzinfo
from
decimal
import
Decimal
from
decimal
import
Decimal
from
uuid
import
uuid4
from
uuid
import
uuid4
import
pytest
from
django.test
import
TestCase
from
django.test
import
TestCase
from
rest_framework.compat
import
coreapi
from
rest_framework.compat
import
coreapi
...
@@ -57,7 +58,7 @@ class JSONEncoderTests(TestCase):
...
@@ -57,7 +58,7 @@ class JSONEncoderTests(TestCase):
current_time
=
datetime
.
now
()
.
time
()
current_time
=
datetime
.
now
()
.
time
()
current_time
=
current_time
.
replace
(
tzinfo
=
UTC
())
current_time
=
current_time
.
replace
(
tzinfo
=
UTC
())
with
self
.
assertR
aises
(
ValueError
):
with
pytest
.
r
aises
(
ValueError
):
self
.
encoder
.
default
(
current_time
)
self
.
encoder
.
default
(
current_time
)
def
test_encode_date
(
self
):
def
test_encode_date
(
self
):
...
@@ -85,8 +86,8 @@ class JSONEncoderTests(TestCase):
...
@@ -85,8 +86,8 @@ class JSONEncoderTests(TestCase):
"""
"""
Tests encoding a coreapi objects raises proper error
Tests encoding a coreapi objects raises proper error
"""
"""
with
self
.
assertR
aises
(
RuntimeError
):
with
pytest
.
r
aises
(
RuntimeError
):
self
.
encoder
.
default
(
coreapi
.
Document
())
self
.
encoder
.
default
(
coreapi
.
Document
())
with
self
.
assertR
aises
(
RuntimeError
):
with
pytest
.
r
aises
(
RuntimeError
):
self
.
encoder
.
default
(
coreapi
.
Error
())
self
.
encoder
.
default
(
coreapi
.
Error
())
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