Update docstrings

This commit is contained in:
Tom Christie 2013-01-15 10:51:10 +00:00
parent 79f635e0dd
commit da6b9576c5

View File

@ -1,5 +1,5 @@
"""
General tests for relational fields.
General serializer field tests.
"""
from django.db import models
@ -29,15 +29,21 @@ class CharPrimaryKeyModelSerializer(serializers.ModelSerializer):
class ReadOnlyFieldTests(TestCase):
def test_auto_now_fields_read_only(self):
"""
auto_now and auto_now_add fields should be readonly by default.
auto_now and auto_now_add fields should be read_only by default.
"""
serializer = TimestampedModelSerializer()
self.assertEquals(serializer.fields['added'].read_only, True)
def test_auto_pk_fields_read_only(self):
"""
AutoField fields should be read_only by default.
"""
serializer = TimestampedModelSerializer()
self.assertEquals(serializer.fields['id'].read_only, True)
def test_non_auto_pk_fields_not_read_only(self):
"""
PK fields other than AutoField fields should not be read_only by default.
"""
serializer = CharPrimaryKeyModelSerializer()
self.assertEquals(serializer.fields['id'].read_only, False)