File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -457,7 +457,7 @@ def smart_urlquote(url):
457457from django .test .client import FakePayload
458458try :
459459 # In 1.5 the test client uses force_bytes
460- from django .utils .encoding import force_bytes_or_smart_bytes
460+ from django .utils .encoding import force_bytes as force_bytes_or_smart_bytes
461461except ImportError :
462462 # In 1.3 and 1.4 the test client just uses smart_str
463463 from django .utils .encoding import smart_str as force_bytes_or_smart_bytes
Original file line number Diff line number Diff line change 1+ import django
2+ from django .test import TestCase
3+
4+
5+ class TestCompat (TestCase ):
6+ def test_force_bytes_or_smart_bytes (self ):
7+ from rest_framework .compat import force_bytes_or_smart_bytes
8+ if django .VERSION >= (1 , 5 ):
9+ from django .utils .encoding import force_bytes
10+ self .assertEqual (force_bytes_or_smart_bytes , force_bytes )
11+ else :
12+ from django .utils .encoding import smart_str
13+ self .assertEqual (force_bytes_or_smart_bytes , smart_str )
You can’t perform that action at this time.
0 commit comments