Skip to content

Commit 78ad54a

Browse files
committed
Fix __in tests under Py3
Py3 tests were broken, fixing those
1 parent fad636a commit 78ad54a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

rest_framework_filters/tests.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ def test_inset_filter(self):
637637
p2 = Person.objects.get(name="Mark").pk
638638

639639
ALL_GET = {
640-
'pk__in': u'%d,%d' % (p1, p2),
640+
'pk__in': '{:d},{:d}'.format(p1, p2),
641641
}
642642
f = InSetLookupPersonFilter(ALL_GET, queryset=Person.objects.all())
643643
f = [x.pk for x in f]
@@ -647,13 +647,13 @@ def test_inset_filter(self):
647647

648648

649649
INVALID_GET = {
650-
'pk__in': u'%d,c%d' % (p1, p2)
650+
'pk__in': '{:d},c{:d}'.format(p1, p2)
651651
}
652652
f = InSetLookupPersonFilter(INVALID_GET, queryset=Person.objects.all())
653653
self.assertEqual(len(list(f)), 0)
654654

655655
EXTRA_GET = {
656-
'pk__in': u'%d,%d,%d' % (p1, p2, p1*p2)
656+
'pk__in': '{:d},{:d},{:d}'.format(p1, p2, p1*p2)
657657
}
658658
f = InSetLookupPersonFilter(EXTRA_GET, queryset=Person.objects.all())
659659
f = [x.pk for x in f]
@@ -662,7 +662,7 @@ def test_inset_filter(self):
662662
self.assertIn(p2, f)
663663

664664
DISORDERED_GET = {
665-
'pk__in': u'%d,%d,%d' % (p2, p2*p1, p1)
665+
'pk__in': '{:d},{:d},{:d}'.format(p2, p2*p1, p1)
666666
}
667667
f = InSetLookupPersonFilter(DISORDERED_GET, queryset=Person.objects.all())
668668
f = [x.pk for x in f]

0 commit comments

Comments
 (0)