Commit cb7d9ea5 by Ben Roberts

cleaned up white space & docstring styling

parent 7f28a784
......@@ -22,9 +22,9 @@ class DictWithMetadata(dict):
"""
A dict-like object, that can have additional properties attached.
"""
def __getstate__(self):
""" Used by pickle (e.g., caching).
"""
Used by pickle (e.g., caching).
Overriden to remove metadata from the dict, since it shouldn't be pickled
and may in some instances be unpickleable.
"""
......@@ -41,7 +41,6 @@ class SortedDictWithMetadata(SortedDict, DictWithMetadata):
pass
def _is_protected_type(obj):
"""
True if the object is a native datatype that does not need to
......
......@@ -645,16 +645,18 @@ class BlankFieldTests(TestCase):
#test for issue #460
class SerializerPickleTests(TestCase):
""" Test pickleability of the output of Serializers
"""
Test pickleability of the output of Serializers
"""
def test_pickle_simple_model_serializer_data(self):
""" Test simple serializer
"""
Test simple serializer
"""
pickle.dumps(PersonSerializer(Person(name="Methusela", age=969)).data)
def test_pickle_inner_serializer(self):
""" Test pickling a serializer whose resulting .data (a SortedDictWithMetadata) will
"""
Test pickling a serializer whose resulting .data (a SortedDictWithMetadata) will
have unpickleable meta data--in order to make sure metadata doesn't get pulled into the pickle.
See DictWithMetadata.__getstate__
"""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment