from django.contrib.localflavor.sk.forms import (SKRegionSelect,
SKPostalCodeField, SKDistrictSelect)
from django.test import SimpleTestCase
class SKLocalFlavorTests(SimpleTestCase):
def test_SKRegionSelect(self):
f = SKRegionSelect()
out = u''''''
self.assertEqual(f.render('regions', 'TT'), out)
def test_SKDistrictSelect(self):
f = SKDistrictSelect()
out = u''''''
self.assertEqual(f.render('Districts', 'RK'), out)
def test_SKPostalCodeField(self):
error_format = [u'Enter a postal code in the format XXXXX or XXX XX.']
valid = {
'91909': '91909',
'917 01': '91701',
}
invalid = {
'84545x': error_format,
}
self.assertFieldOutput(SKPostalCodeField, valid, invalid)