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
|
||||
|
||||
from django.contrib.localflavor.be.forms import (BEPostalCodeField,
|
||||
BEPhoneNumberField, BERegionSelect, BEProvinceSelect)
|
||||
|
||||
@@ -6,10 +8,10 @@ from django.test import SimpleTestCase
|
||||
|
||||
class BELocalFlavorTests(SimpleTestCase):
|
||||
def test_BEPostalCodeField(self):
|
||||
error_format = [u'Enter a valid postal code in the range and format 1XXX - 9XXX.']
|
||||
error_format = ['Enter a valid postal code in the range and format 1XXX - 9XXX.']
|
||||
valid = {
|
||||
u'1451': '1451',
|
||||
u'2540': '2540',
|
||||
'1451': '1451',
|
||||
'2540': '2540',
|
||||
}
|
||||
invalid = {
|
||||
'0287': error_format,
|
||||
@@ -28,17 +30,17 @@ class BELocalFlavorTests(SimpleTestCase):
|
||||
'0xxxxxxxx or 04xxxxxxxx.')
|
||||
]
|
||||
valid = {
|
||||
u'01 234 56 78': '01 234 56 78',
|
||||
u'01/234.56.78': '01/234.56.78',
|
||||
u'01.234.56.78': '01.234.56.78',
|
||||
u'012 34 56 78': '012 34 56 78',
|
||||
u'012/34.56.78': '012/34.56.78',
|
||||
u'012.34.56.78': '012.34.56.78',
|
||||
u'0412 34 56 78': '0412 34 56 78',
|
||||
u'0412/34.56.78': '0412/34.56.78',
|
||||
u'0412.34.56.78': '0412.34.56.78',
|
||||
u'012345678': '012345678',
|
||||
u'0412345678': '0412345678',
|
||||
'01 234 56 78': '01 234 56 78',
|
||||
'01/234.56.78': '01/234.56.78',
|
||||
'01.234.56.78': '01.234.56.78',
|
||||
'012 34 56 78': '012 34 56 78',
|
||||
'012/34.56.78': '012/34.56.78',
|
||||
'012.34.56.78': '012.34.56.78',
|
||||
'0412 34 56 78': '0412 34 56 78',
|
||||
'0412/34.56.78': '0412/34.56.78',
|
||||
'0412.34.56.78': '0412.34.56.78',
|
||||
'012345678': '012345678',
|
||||
'0412345678': '0412345678',
|
||||
}
|
||||
invalid = {
|
||||
'01234567': error_format,
|
||||
@@ -54,7 +56,7 @@ class BELocalFlavorTests(SimpleTestCase):
|
||||
|
||||
def test_BERegionSelect(self):
|
||||
f = BERegionSelect()
|
||||
out = u'''<select name="regions">
|
||||
out = '''<select name="regions">
|
||||
<option value="BRU">Brussels Capital Region</option>
|
||||
<option value="VLG" selected="selected">Flemish Region</option>
|
||||
<option value="WAL">Wallonia</option>
|
||||
@@ -63,7 +65,7 @@ class BELocalFlavorTests(SimpleTestCase):
|
||||
|
||||
def test_BEProvinceSelect(self):
|
||||
f = BEProvinceSelect()
|
||||
out = u'''<select name="provinces">
|
||||
out = '''<select name="provinces">
|
||||
<option value="VAN">Antwerp</option>
|
||||
<option value="BRU">Brussels</option>
|
||||
<option value="VOV">East Flanders</option>
|
||||
|
||||
Reference in New Issue
Block a user