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/
|
||||
/env/
|
||||
MANIFEST
|
||||
coverage.*
|
||||
|
||||
!.gitignore
|
||||
!.travis.yml
|
||||
|
|
|
@ -14,13 +14,13 @@ class NestedSerializer(serializers.Serializer):
|
|||
two = serializers.IntegerField(max_value=10)
|
||||
|
||||
|
||||
class TestNestedSerializerSerializer(serializers.Serializer):
|
||||
class NestedSerializerTestSerializer(serializers.Serializer):
|
||||
nested = NestedSerializer()
|
||||
|
||||
|
||||
class NestedSerializersView(ListCreateAPIView):
|
||||
renderer_classes = (BrowsableAPIRenderer, )
|
||||
serializer_class = TestNestedSerializerSerializer
|
||||
serializer_class = NestedSerializerTestSerializer
|
||||
queryset = [{'nested': {'one': 1, 'two': 2}}]
|
||||
|
||||
|
||||
|
|
|
@ -784,7 +784,7 @@ class TestBulkCreate(TestCase):
|
|||
assert serializer.data == data
|
||||
|
||||
|
||||
class TestMetaClassModel(models.Model):
|
||||
class MetaClassTestModel(models.Model):
|
||||
text = models.CharField(max_length=100)
|
||||
|
||||
|
||||
|
@ -792,7 +792,7 @@ class TestSerializerMetaClass(TestCase):
|
|||
def test_meta_class_fields_option(self):
|
||||
class ExampleSerializer(serializers.ModelSerializer):
|
||||
class Meta:
|
||||
model = TestMetaClassModel
|
||||
model = MetaClassTestModel
|
||||
fields = 'text'
|
||||
|
||||
with self.assertRaises(TypeError) as result:
|
||||
|
@ -806,7 +806,7 @@ class TestSerializerMetaClass(TestCase):
|
|||
def test_meta_class_exclude_option(self):
|
||||
class ExampleSerializer(serializers.ModelSerializer):
|
||||
class Meta:
|
||||
model = TestMetaClassModel
|
||||
model = MetaClassTestModel
|
||||
exclude = 'text'
|
||||
|
||||
with self.assertRaises(TypeError) as result:
|
||||
|
@ -820,7 +820,7 @@ class TestSerializerMetaClass(TestCase):
|
|||
def test_meta_class_fields_and_exclude_options(self):
|
||||
class ExampleSerializer(serializers.ModelSerializer):
|
||||
class Meta:
|
||||
model = TestMetaClassModel
|
||||
model = MetaClassTestModel
|
||||
fields = ('text',)
|
||||
exclude = ('text',)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user