forked from typeddjango/djangorestframework-stubs
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Turns out it's already should be using github-ci, we need only minor fixes.
- Loading branch information
1 parent
9b3a693
commit 2a44546
Showing
12 changed files
with
97 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,17 @@ | ||
from rest_framework import status | ||
from rest_framework.decorators import permission_classes | ||
from rest_framework.permissions import IsAdminUser, IsAuthenticated | ||
from rest_framework.test import APIClient | ||
from typing_extensions import assert_type | ||
|
||
|
||
def test_restframework_types() -> None: | ||
def test_test_client_types() -> None: | ||
client = APIClient() | ||
|
||
res = client.get("/api/v1/foo") | ||
assert res.status_code == status.HTTP_200_OK | ||
print(res.data) | ||
assert res.json() == {"test": "foo"} | ||
|
||
assert_type(res.status_code, int) | ||
|
||
|
||
def test_decorator_types() -> None: | ||
permission_classes([IsAuthenticated]) | ||
permission_classes([IsAuthenticated | IsAdminUser]) |