mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-18 12:12:19 +03:00
fix formatting issues for list serializer validation fix
This commit is contained in:
parent
a717d74f3c
commit
4bbc689ec5
|
@ -2,6 +2,7 @@ import inspect
|
|||
import pickle
|
||||
import re
|
||||
import sys
|
||||
import unittest
|
||||
from collections import ChainMap
|
||||
from collections.abc import Mapping
|
||||
|
||||
|
@ -10,7 +11,6 @@ from django.db import models
|
|||
|
||||
from rest_framework import exceptions, fields, relations, serializers
|
||||
from rest_framework.fields import Field
|
||||
|
||||
from .models import (
|
||||
ForeignKeyTarget, NestedForeignKeySource, NullableForeignKeySource
|
||||
)
|
||||
|
@ -787,9 +787,6 @@ class MyClassSerializer(serializers.ModelSerializer):
|
|||
return value
|
||||
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
class TestMultipleObjectsValidation(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.objs = [
|
||||
|
@ -818,7 +815,7 @@ class TestMultipleObjectsValidation(unittest.TestCase):
|
|||
def test_exception_raised_when_data_and_instance_length_different(self):
|
||||
|
||||
with self.assertRaises(AssertionError):
|
||||
serializer = MyClassSerializer(
|
||||
MyClassSerializer(
|
||||
data=[{'value': 'set', 'id': instance.id} for instance in
|
||||
self.objs],
|
||||
instance=self.objs[:-1],
|
||||
|
|
Loading…
Reference in New Issue
Block a user