mirror of
https://github.com/django/django.git
synced 2025-10-29 08:36:09 +00:00
Fixed #18269 -- Applied unicode_literals for Python 3 compatibility.
Thanks Vinay Sajip for the support of his django3 branch and Jannis Leidel for the review.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import absolute_import, unicode_literals
|
||||
|
||||
from django.test import TestCase
|
||||
|
||||
@@ -77,7 +77,7 @@ class AdvancedTests(TestCase):
|
||||
resp = DataPoint.objects.filter(value="banana").update(
|
||||
value="pineapple")
|
||||
self.assertEqual(resp, 2)
|
||||
self.assertEqual(DataPoint.objects.get(name="d2").value, u'pineapple')
|
||||
self.assertEqual(DataPoint.objects.get(name="d2").value, 'pineapple')
|
||||
|
||||
def test_update_fk(self):
|
||||
"""
|
||||
@@ -97,8 +97,8 @@ class AdvancedTests(TestCase):
|
||||
value="fruit", another_value="peach")
|
||||
self.assertEqual(resp, 1)
|
||||
d = DataPoint.objects.get(name="d0")
|
||||
self.assertEqual(d.value, u'fruit')
|
||||
self.assertEqual(d.another_value, u'peach')
|
||||
self.assertEqual(d.value, 'fruit')
|
||||
self.assertEqual(d.another_value, 'peach')
|
||||
|
||||
def test_update_all(self):
|
||||
"""
|
||||
@@ -107,7 +107,7 @@ class AdvancedTests(TestCase):
|
||||
"""
|
||||
self.assertEqual(DataPoint.objects.update(value='thing'), 3)
|
||||
resp = DataPoint.objects.values('value').distinct()
|
||||
self.assertEqual(list(resp), [{'value': u'thing'}])
|
||||
self.assertEqual(list(resp), [{'value': 'thing'}])
|
||||
|
||||
def test_update_slice_fail(self):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user