mirror of
https://github.com/django/django.git
synced 2025-11-07 07:15:35 +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,3 +1,5 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import warnings
|
||||
|
||||
from django.contrib.localflavor.ca.forms import (CAPostalCodeField,
|
||||
@@ -21,7 +23,7 @@ class CALocalFlavorTests(SimpleTestCase):
|
||||
|
||||
def test_CAProvinceSelect(self):
|
||||
f = CAProvinceSelect()
|
||||
out = u'''<select name="province">
|
||||
out = '''<select name="province">
|
||||
<option value="AB" selected="selected">Alberta</option>
|
||||
<option value="BC">British Columbia</option>
|
||||
<option value="MB">Manitoba</option>
|
||||
@@ -39,7 +41,7 @@ class CALocalFlavorTests(SimpleTestCase):
|
||||
self.assertHTMLEqual(f.render('province', 'AB'), out)
|
||||
|
||||
def test_CAPostalCodeField(self):
|
||||
error_format = [u'Enter a postal code in the format XXX XXX.']
|
||||
error_format = ['Enter a postal code in the format XXX XXX.']
|
||||
valid = {
|
||||
'T2S 2H7': 'T2S 2H7',
|
||||
'T2S 2W7': 'T2S 2W7',
|
||||
@@ -69,7 +71,7 @@ class CALocalFlavorTests(SimpleTestCase):
|
||||
self.assertFieldOutput(CAPostalCodeField, valid, invalid)
|
||||
|
||||
def test_CAPhoneNumberField(self):
|
||||
error_format = [u'Phone numbers must be in XXX-XXX-XXXX format.']
|
||||
error_format = ['Phone numbers must be in XXX-XXX-XXXX format.']
|
||||
valid = {
|
||||
'403-555-1212': '403-555-1212',
|
||||
'4035551212': '403-555-1212',
|
||||
@@ -87,7 +89,7 @@ class CALocalFlavorTests(SimpleTestCase):
|
||||
self.assertFieldOutput(CAPhoneNumberField, valid, invalid)
|
||||
|
||||
def test_CAProvinceField(self):
|
||||
error_format = [u'Enter a Canadian province or territory.']
|
||||
error_format = ['Enter a Canadian province or territory.']
|
||||
valid = {
|
||||
'ab': 'AB',
|
||||
'BC': 'BC',
|
||||
@@ -101,7 +103,7 @@ class CALocalFlavorTests(SimpleTestCase):
|
||||
self.assertFieldOutput(CAProvinceField, valid, invalid)
|
||||
|
||||
def test_CASocialInsuranceField(self):
|
||||
error_format = [u'Enter a valid Canadian Social Insurance number in XXX-XXX-XXX format.']
|
||||
error_format = ['Enter a valid Canadian Social Insurance number in XXX-XXX-XXX format.']
|
||||
valid = {
|
||||
'046-454-286': '046-454-286',
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user