aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework
diff options
context:
space:
mode:
authorBen Roberts2012-12-06 12:45:50 -0700
committerBen Roberts2012-12-06 12:45:50 -0700
commitcb7d9ea5c9843ffa99db4400670a11c3651520cc (patch)
treee37cdcb9a71c2bff470df64535d18493f4155f29 /rest_framework
parent7f28a784146b9ba6ab303e79597f85a0f8b1e76e (diff)
downloaddjango-rest-framework-cb7d9ea5c9843ffa99db4400670a11c3651520cc.tar.bz2
cleaned up white space & docstring styling
Diffstat (limited to 'rest_framework')
-rw-r--r--rest_framework/serializers.py9
-rw-r--r--rest_framework/tests/serializer.py14
2 files changed, 12 insertions, 11 deletions
diff --git a/rest_framework/serializers.py b/rest_framework/serializers.py
index fcc0744a..51e0b664 100644
--- a/rest_framework/serializers.py
+++ b/rest_framework/serializers.py
@@ -22,11 +22,11 @@ class DictWithMetadata(dict):
"""
A dict-like object, that can have additional properties attached.
"""
-
def __getstate__(self):
- """ 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.
+ """
+ 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.
"""
# return an instance of the first dict in MRO that isn't a DictWithMetadata
for base in self.__class__.__mro__:
@@ -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
diff --git a/rest_framework/tests/serializer.py b/rest_framework/tests/serializer.py
index 9cedb54b..31dd3699 100644
--- a/rest_framework/tests/serializer.py
+++ b/rest_framework/tests/serializer.py
@@ -645,18 +645,20 @@ 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
- have unpickleable meta data--in order to make sure metadata doesn't get pulled into the pickle.
- See DictWithMetadata.__getstate__
+ """
+ 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__
"""
class InnerPersonSerializer(serializers.ModelSerializer):
class Meta: