def test_source_is_read_only(self):
     serializer = AccountInfoSerializer(
         instance=None,
         data={'source': mkt.LOGIN_SOURCE_FXA, 'display_name': 'Hey!'},
         partial=True)
     eq_(serializer.is_valid(), True)
     # This works because the model field is `editable=False`.
     eq_(serializer.save().source, mkt.LOGIN_SOURCE_UNKNOWN)
Esempio n. 2
0
 def test_source_is_read_only(self):
     serializer = AccountInfoSerializer(
         instance=None,
         data={'source': mkt.LOGIN_SOURCE_FXA, 'display_name': 'Hey!'},
         partial=True)
     eq_(serializer.is_valid(), True)
     # This works because the model field is `editable=False`.
     eq_(serializer.save().source, mkt.LOGIN_SOURCE_UNKNOWN)
Esempio n. 3
0
 def serializer(self):
     return AccountInfoSerializer(instance=self.account)