mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-28 04:24:00 +03:00
Fix warnings when running tests (#4047)
This commit is contained in:
parent
d87f2bc7b6
commit
08dad04b19
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -11,6 +11,7 @@
|
||||||
/*.egg-info/
|
/*.egg-info/
|
||||||
/env/
|
/env/
|
||||||
MANIFEST
|
MANIFEST
|
||||||
|
coverage.*
|
||||||
|
|
||||||
!.gitignore
|
!.gitignore
|
||||||
!.travis.yml
|
!.travis.yml
|
||||||
|
|
|
@ -14,13 +14,13 @@ class NestedSerializer(serializers.Serializer):
|
||||||
two = serializers.IntegerField(max_value=10)
|
two = serializers.IntegerField(max_value=10)
|
||||||
|
|
||||||
|
|
||||||
class TestNestedSerializerSerializer(serializers.Serializer):
|
class NestedSerializerTestSerializer(serializers.Serializer):
|
||||||
nested = NestedSerializer()
|
nested = NestedSerializer()
|
||||||
|
|
||||||
|
|
||||||
class NestedSerializersView(ListCreateAPIView):
|
class NestedSerializersView(ListCreateAPIView):
|
||||||
renderer_classes = (BrowsableAPIRenderer, )
|
renderer_classes = (BrowsableAPIRenderer, )
|
||||||
serializer_class = TestNestedSerializerSerializer
|
serializer_class = NestedSerializerTestSerializer
|
||||||
queryset = [{'nested': {'one': 1, 'two': 2}}]
|
queryset = [{'nested': {'one': 1, 'two': 2}}]
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -784,7 +784,7 @@ class TestBulkCreate(TestCase):
|
||||||
assert serializer.data == data
|
assert serializer.data == data
|
||||||
|
|
||||||
|
|
||||||
class TestMetaClassModel(models.Model):
|
class MetaClassTestModel(models.Model):
|
||||||
text = models.CharField(max_length=100)
|
text = models.CharField(max_length=100)
|
||||||
|
|
||||||
|
|
||||||
|
@ -792,7 +792,7 @@ class TestSerializerMetaClass(TestCase):
|
||||||
def test_meta_class_fields_option(self):
|
def test_meta_class_fields_option(self):
|
||||||
class ExampleSerializer(serializers.ModelSerializer):
|
class ExampleSerializer(serializers.ModelSerializer):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = TestMetaClassModel
|
model = MetaClassTestModel
|
||||||
fields = 'text'
|
fields = 'text'
|
||||||
|
|
||||||
with self.assertRaises(TypeError) as result:
|
with self.assertRaises(TypeError) as result:
|
||||||
|
@ -806,7 +806,7 @@ class TestSerializerMetaClass(TestCase):
|
||||||
def test_meta_class_exclude_option(self):
|
def test_meta_class_exclude_option(self):
|
||||||
class ExampleSerializer(serializers.ModelSerializer):
|
class ExampleSerializer(serializers.ModelSerializer):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = TestMetaClassModel
|
model = MetaClassTestModel
|
||||||
exclude = 'text'
|
exclude = 'text'
|
||||||
|
|
||||||
with self.assertRaises(TypeError) as result:
|
with self.assertRaises(TypeError) as result:
|
||||||
|
@ -820,7 +820,7 @@ class TestSerializerMetaClass(TestCase):
|
||||||
def test_meta_class_fields_and_exclude_options(self):
|
def test_meta_class_fields_and_exclude_options(self):
|
||||||
class ExampleSerializer(serializers.ModelSerializer):
|
class ExampleSerializer(serializers.ModelSerializer):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = TestMetaClassModel
|
model = MetaClassTestModel
|
||||||
fields = ('text',)
|
fields = ('text',)
|
||||||
exclude = ('text',)
|
exclude = ('text',)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user