Skip to content

Commit 0b8b288

Browse files
committed
python2 compat
1 parent 8c7b5fc commit 0b8b288

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/test_model_serializer.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,13 @@ class Meta:
419419
class Meta:
420420
validators = [<UniqueTogetherValidator(queryset=UniqueTogetherModel.objects.all(), fields=('foreign_key', 'one_to_one'))>]
421421
""")
422+
if six.PY2:
423+
# This case is also too awkward to resolve fully across both py2
424+
# and py3. (See above)
425+
expected = expected.replace(
426+
"('foreign_key', 'one_to_one')",
427+
"(u'foreign_key', u'one_to_one')"
428+
)
422429
self.assertEqual(unicode_repr(TestSerializer()), expected)
423430

424431
def test_pk_reverse_foreign_key(self):

0 commit comments

Comments
 (0)