Example #1
0
 def test_to_representation(self):
     """Test that when we return a reprensentation to the client, we convert
     the internal value in an human-readable format
     (e.g. a string constant)."""
     field = ReverseChoiceField(choices=(('internal', 'human'),))
     assert field.to_representation('internal') == 'human'
Example #2
0
 def test_to_representation(self):
     """Test that when we return a reprensentation to the client, we convert
     the internal value in an human-readable format
     (e.g. a string constant)."""
     field = ReverseChoiceField(choices=(('internal', 'human'),))
     assert field.to_representation('internal') == 'human'