Skip to content

Assert that Serializer was initialized with data=something in is_valid() #2228

@loic

Description

@loic
>>> serializer = SnippetSerializer(snippet)
>>> serializer.is_valid()
False
>>> serializer.errors
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/Users/loic/Dev/django-rest-framework/rest_framework/serializers.py", line 429, in errors
    return ReturnDict(ret, serializer=self)
  File "/Users/loic/Dev/django-rest-framework/rest_framework/utils/serializer_helpers.py", line 13, in __init__
    super(ReturnDict, self).__init__(*args, **kwargs)
  File "/usr/local/Cellar/python/2.7.8_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/collections.py", line 52, in __init__
    self.__update(*args, **kwds)
  File "/Users/loic/Dev/rest_tutorial/./.venv/bin/../lib/python2.7/_abcoll.py", line 566, in update
    for key, value in other:
ValueError: too many values to unpack

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy