-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pre-commit imporanize pyupgrade and docformat
- Loading branch information
Showing
15 changed files
with
133 additions
and
89 deletions.
There are no files selected for viewing
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ cache: | |
|
||
python: | ||
- "3.7" | ||
- "3.8" | ||
|
||
install: | ||
- pip install tox-travis | ||
|
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
include *.rc | ||
include *.editorconfig | ||
include *.rst | ||
include *.toml | ||
include *.txt | ||
include *.yaml *.yml | ||
include LICENSE | ||
include Makefile | ||
include pytest.ini | ||
include tox.ini | ||
recursive-exclude * __pycache__ | ||
recursive-exclude * *.py[co] | ||
|
||
recursive-include rest_dataclasses *.py | ||
|
||
recursive-include docs * | ||
recursive-exclude docs/_build * | ||
|
||
recursive-include tests * | ||
recursive-include test_site * |
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,4 +1,14 @@ | ||
# -*- coding: utf-8 -*- | ||
from __future__ import absolute_import, print_function, unicode_literals | ||
from .__version__ import ( | ||
__author__, | ||
__author_email__, | ||
__description__, | ||
__version__, | ||
) | ||
|
||
from .__version__ import __author__, __author_email__, __description__, __version__ # noqa | ||
|
||
__all__ = [ | ||
"__author__", | ||
"__author_email__", | ||
"__description__", | ||
"__version__", | ||
] |
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,9 +1,3 @@ | ||
# -*- coding: utf-8 -*- | ||
from __future__ import absolute_import, print_function, unicode_literals | ||
|
||
|
||
# -*- coding: utf-8 -*- | ||
|
||
__author__ = "Serkan Hosca" | ||
__author_email__ = "[email protected]" | ||
__version__ = "0.0.3" | ||
|
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,17 +1,13 @@ | ||
# -*- coding: utf-8 -*- | ||
from __future__ import absolute_import, print_function, unicode_literals | ||
import dataclasses as da | ||
import enum | ||
from typing import Dict, List | ||
|
||
from django.core.exceptions import ValidationError as DjangoValidationError | ||
from django.test import SimpleTestCase | ||
|
||
from rest_dataclasses.serializers import DataclassSerializer | ||
from rest_framework import fields | ||
from rest_framework.exceptions import ValidationError | ||
|
||
from rest_dataclasses.serializers import DataclassSerializer | ||
|
||
|
||
class Color(enum.Enum): | ||
RED = "red" | ||
|
@@ -82,7 +78,9 @@ class Meta: | |
fields = "id,name" | ||
|
||
serializer = Serializer(data={"id": 1, "name": "shosca", "email": "[email protected]"}) | ||
with self.assertRaisesMessage(TypeError, 'The `fields` option must be a list or tuple or "__all__". Got str.'): | ||
with self.assertRaisesMessage( | ||
TypeError, 'The `fields` option must be a list or tuple or "__all__". Got str.', | ||
): | ||
serializer.is_valid(raise_exception=True) | ||
|
||
def test_bad_exclude(self): | ||
|
@@ -256,7 +254,10 @@ class Serializer(DataclassSerializer): | |
class Meta: | ||
model = Line | ||
fields = "__all__" | ||
extra_kwargs = {"a": {"allow_null": False, "allow_create": False}, "b": {"allow_null": False}} | ||
extra_kwargs = { | ||
"a": {"allow_null": False, "allow_create": False}, | ||
"b": {"allow_null": False}, | ||
} | ||
|
||
instance = Line() | ||
|
||
|
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