Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Web - Open
drf-sqla
Commits
c33e7ad9
Commit
c33e7ad9
authored
Oct 10, 2014
by
Ashish
Browse files
Added test for count and page
parent
816ccf58
Changes
1
Hide whitespace changes
Inline
Side-by-side
djangorest_alchemy/tests/test_viewsets.py
View file @
c33e7ad9
...
...
@@ -22,6 +22,8 @@ from rest_framework.decorators import action
RESULTS_KEY
=
"results"
COUNT_KEY
=
"count"
PAGE_KEY
=
"page"
class
PrimaryKeyMixin
(
object
):
...
...
@@ -104,6 +106,8 @@ class TestAlchemyViewSetIntegration(TestCase):
self
.
assertTrue
(
resp
.
status_code
is
status
.
HTTP_200_OK
)
self
.
assertTrue
(
type
(
resp
.
data
)
is
dict
)
self
.
assertTrue
(
len
(
resp
.
data
[
RESULTS_KEY
])
==
1
)
self
.
assertTrue
(
resp
.
data
[
COUNT_KEY
]
==
1
)
self
.
assertTrue
(
resp
.
data
[
PAGE_KEY
]
==
25
)
def
test_decl_retrieve
(
self
):
resp
=
self
.
client
.
get
(
'/api/declmodels/1/'
)
...
...
Write
Preview
Supports
Markdown
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