Fix #4198 by gcbirzan · Pull Request #4199 · encode/django-rest-framework (original) (raw)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That particular test is TestMetaInheritance which doesn't try to set the
field, just checks whether it's set as read only. While the logic of the
test is not totally preserved, that's because the functionality changed.

On Wed, Jun 15, 2016 at 5:35 PM, Kevin Brown notifications@github.com
wrote:

In tests/test_model_serializer.py
#4199 (comment)
:

@@ -933,8 +933,8 @@ class TestSerializer(serializers.ModelSerializer):

        class Meta:
            model = OneFieldModel
  • ```
    read_only_fields = ('char_field', 'non_model_field')
* ```  
          fields = read_only_fields  
  • ```
    read_only_fields = ('char_field',)
* ```  
          fields = read_only_fields + ('non_model_field', )  

Shouldn't this make a test or two fail because non_model_field isn't
actually specified as read-only anymore?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/tomchristie/django-rest-framework/pull/4199/files/5dd336ec6ca80dbcabaa1be054ac5a7f2f6c2a7d#r67173621,
or mute the thread
https://github.com/notifications/unsubscribe/AAv3ZSrABzE7kkWUp_UjAk2VfX6UOQVjks5qMA2ogaJpZM4I2QWM
.

George-Cristian Bîrzan