mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-26 11:33:59 +03:00
python2 compat
This commit is contained in:
parent
8c7b5fc5c1
commit
0b8b288be5
|
@ -419,6 +419,13 @@ class TestRelationalFieldMappings(TestCase):
|
||||||
class Meta:
|
class Meta:
|
||||||
validators = [<UniqueTogetherValidator(queryset=UniqueTogetherModel.objects.all(), fields=('foreign_key', 'one_to_one'))>]
|
validators = [<UniqueTogetherValidator(queryset=UniqueTogetherModel.objects.all(), fields=('foreign_key', 'one_to_one'))>]
|
||||||
""")
|
""")
|
||||||
|
if six.PY2:
|
||||||
|
# This case is also too awkward to resolve fully across both py2
|
||||||
|
# and py3. (See above)
|
||||||
|
expected = expected.replace(
|
||||||
|
"('foreign_key', 'one_to_one')",
|
||||||
|
"(u'foreign_key', u'one_to_one')"
|
||||||
|
)
|
||||||
self.assertEqual(unicode_repr(TestSerializer()), expected)
|
self.assertEqual(unicode_repr(TestSerializer()), expected)
|
||||||
|
|
||||||
def test_pk_reverse_foreign_key(self):
|
def test_pk_reverse_foreign_key(self):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user