Skip to content

Commit 8fd2585

Browse files
author
Jannon Frank
committed
flake8 fixes
1 parent add2825 commit 8fd2585

File tree

1 file changed

+44
-43
lines changed

1 file changed

+44
-43
lines changed

tests/test_metadata.py

Lines changed: 44 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import unicode_literals
22
from django.db import models
33
from django.test import TestCase
4-
from django.core.validators import MinValueValidator, MaxValueValidator, MinLengthValidator
4+
from django.core.validators import MinValueValidator, MaxValueValidator
55
from rest_framework import exceptions, metadata, serializers, status, views, versioning
66
from rest_framework.request import Request
77
from rest_framework.renderers import BrowsableAPIRenderer
@@ -234,6 +234,7 @@ class Child(models.Model):
234234

235235
class ExampleSerializer(serializers.ModelSerializer):
236236
children = serializers.PrimaryKeyRelatedField(read_only=True, many=True)
237+
237238
class Meta:
238239
model = Parent
239240

@@ -248,49 +249,49 @@ def get_serializer(self):
248249
view = ExampleView.as_view()
249250
response = view(request=request)
250251
expected = {
251-
'name': 'Example',
252-
'description': 'Example view.',
253-
'renders': [
254-
'application/json',
255-
'text/html'
256-
],
257-
'parses': [
258-
'application/json',
259-
'application/x-www-form-urlencoded',
260-
'multipart/form-data'
261-
],
262-
'actions': {
263-
'POST': {
264-
'id': {
265-
'type': 'integer',
266-
'required': False,
267-
'read_only': True,
268-
'label': 'ID'
269-
},
270-
'children': {
271-
'type': 'field',
272-
'required': False,
273-
'read_only': True,
274-
'label': 'Children'
275-
},
276-
'integer_field': {
277-
'type': 'integer',
278-
'required': True,
279-
'read_only': False,
280-
'label': 'Integer field',
281-
'min_value': 1,
282-
'max_value': 1000
283-
},
284-
'name': {
285-
'type': 'string',
286-
'required': False,
287-
'read_only': False,
288-
'label': 'Name',
289-
'max_length': 100
290-
}
291-
}
292-
}
252+
'name': 'Example',
253+
'description': 'Example view.',
254+
'renders': [
255+
'application/json',
256+
'text/html'
257+
],
258+
'parses': [
259+
'application/json',
260+
'application/x-www-form-urlencoded',
261+
'multipart/form-data'
262+
],
263+
'actions': {
264+
'POST': {
265+
'id': {
266+
'type': 'integer',
267+
'required': False,
268+
'read_only': True,
269+
'label': 'ID'
270+
},
271+
'children': {
272+
'type': 'field',
273+
'required': False,
274+
'read_only': True,
275+
'label': 'Children'
276+
},
277+
'integer_field': {
278+
'type': 'integer',
279+
'required': True,
280+
'read_only': False,
281+
'label': 'Integer field',
282+
'min_value': 1,
283+
'max_value': 1000
284+
},
285+
'name': {
286+
'type': 'string',
287+
'required': False,
288+
'read_only': False,
289+
'label': 'Name',
290+
'max_length': 100
293291
}
292+
}
293+
}
294+
}
294295

295296
assert response.status_code == status.HTTP_200_OK
296297
assert response.data == expected

0 commit comments

Comments
 (0)