diff options
| author | Tom Christie | 2014-12-15 09:20:27 +0000 | 
|---|---|---|
| committer | Tom Christie | 2014-12-15 09:20:27 +0000 | 
| commit | 8934e61b67e4aed38b04f2fe18f011ecbf9010cb (patch) | |
| tree | 479517fbfb5b9fa8c989c28ecc5f4f0ef4ec47d0 /tests/test_serializer.py | |
| parent | d232c5739e13da1c3e0461c79e9e124f576f1c05 (diff) | |
| parent | d22c0007b3ec9e4d7105afc4f7a2cb9a89c0f97b (diff) | |
| download | django-rest-framework-8934e61b67e4aed38b04f2fe18f011ecbf9010cb.tar.bz2 | |
Merge branch 'jpadilla-exception-handler-context' into version-3.1
Diffstat (limited to 'tests/test_serializer.py')
| -rw-r--r-- | tests/test_serializer.py | 17 | 
1 files changed, 17 insertions, 0 deletions
| diff --git a/tests/test_serializer.py b/tests/test_serializer.py index 56b39095..48fcc83b 100644 --- a/tests/test_serializer.py +++ b/tests/test_serializer.py @@ -1,3 +1,4 @@ +# coding: utf-8  from __future__ import unicode_literals  from rest_framework import serializers  import pytest @@ -197,3 +198,19 @@ class TestIncorrectlyConfigured:              "The serializer field might be named incorrectly and not match any attribute or key on the `ExampleObject` instance.\n"              "Original exception text was:"          ) + + +class TestUnicodeRepr: +    def test_unicode_repr(self): +        class ExampleSerializer(serializers.Serializer): +            example = serializers.CharField() + +        class ExampleObject: +            def __init__(self): +                self.example = '한국' +            def __repr__(self): +                return self.example.encode('utf8') + +        instance = ExampleObject() +        serializer = ExampleSerializer(instance) +        repr(serializer) | 
