2012-06-07 16:08:47 +00:00
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
2011-06-28 10:17:23 +00:00
|
|
|
from django.contrib.localflavor.py.forms import (PyDepartmentSelect,
|
|
|
|
PyNumberedDepartmentSelect)
|
|
|
|
|
2011-08-23 02:32:37 +00:00
|
|
|
from django.test import SimpleTestCase
|
2011-06-28 10:17:23 +00:00
|
|
|
|
2011-08-23 02:32:37 +00:00
|
|
|
class PYLocalFlavorTests(SimpleTestCase):
|
2011-06-28 10:17:23 +00:00
|
|
|
def test_PyDepartmentSelect(self):
|
|
|
|
py = PyDepartmentSelect()
|
2012-06-07 16:08:47 +00:00
|
|
|
out = '''<select name="department">
|
2011-06-28 10:17:23 +00:00
|
|
|
<option value="AG">Alto Paraguay</option>
|
|
|
|
<option value="AA">Alto Paran\xe1</option>
|
|
|
|
<option value="AM">Amambay</option>
|
|
|
|
<option value="AS">Asunci\xf3n</option>
|
|
|
|
<option value="BQ">Boquer\xf3n</option>
|
|
|
|
<option value="CG">Caaguaz\xfa</option>
|
|
|
|
<option value="CZ">Caazap\xe1</option>
|
|
|
|
<option value="CY">Canindey\xfa</option>
|
|
|
|
<option value="CE">Central</option>
|
|
|
|
<option value="CN">Concepci\xf3n</option>
|
|
|
|
<option value="CR">Cordillera</option>
|
|
|
|
<option value="GU">Guair\xe1</option>
|
|
|
|
<option value="IT">Itap\xfaa</option>
|
|
|
|
<option value="MI">Misiones</option>
|
|
|
|
<option value="NE">\xd1eembuc\xfa</option>
|
|
|
|
<option value="PG">Paraguar\xed</option>
|
|
|
|
<option value="PH">Pdte. Hayes</option>
|
|
|
|
<option value="SP">San Pedro</option>
|
|
|
|
</select>'''
|
2012-01-31 20:36:11 +00:00
|
|
|
self.assertHTMLEqual(py.render('department', 'M'), out)
|
2011-06-28 10:17:23 +00:00
|
|
|
|
|
|
|
def test_PyNumberedDepartmentSelect(self):
|
|
|
|
py = PyNumberedDepartmentSelect()
|
2012-06-07 16:08:47 +00:00
|
|
|
out = '''<select name="department">
|
2011-06-28 10:17:23 +00:00
|
|
|
<option value="CN">I Concepci\xf3n</option>
|
|
|
|
<option value="SP">II San Pedro</option>
|
|
|
|
<option value="CR">III Cordillera</option>
|
|
|
|
<option value="GU">IV Guair\xe1</option>
|
|
|
|
<option value="CG">V Caaguaz\xfa</option>
|
|
|
|
<option value="CZ">VI Caazap\xe1</option>
|
|
|
|
<option value="IT">VII Itap\xfaa</option>
|
|
|
|
<option value="MI">VIII Misiones</option>
|
|
|
|
<option value="PG">IX Paraguar\xed</option>
|
|
|
|
<option value="AA">X Alto Paran\xe1</option>
|
|
|
|
<option value="CE">XI Central</option>
|
|
|
|
<option value="NE">XII \xd1eembuc\xfa</option>
|
|
|
|
<option value="AM" selected="selected">XIII Amambay</option>
|
|
|
|
<option value="CY">XIV Canindey\xfa</option>
|
|
|
|
<option value="PH">XV Pdte. Hayes</option>
|
|
|
|
<option value="AG">XVI Alto Paraguay</option>
|
|
|
|
<option value="BQ">XVII Boquer\xf3n</option>
|
|
|
|
<option value="AS">XVIII Asunci\xf3n</option>
|
|
|
|
</select>'''
|
2012-01-31 20:36:11 +00:00
|
|
|
self.assertHTMLEqual(py.render('department', 'AM'), out)
|