diff --git a/tests/regressiontests/forms/localflavor/__init__.py b/tests/regressiontests/forms/localflavor/__init__.py deleted file mode 100644 index 792d600548..0000000000 --- a/tests/regressiontests/forms/localflavor/__init__.py +++ /dev/null @@ -1 +0,0 @@ -# diff --git a/tests/regressiontests/forms/localflavor/au.py b/tests/regressiontests/forms/localflavor/au.py deleted file mode 100644 index 9a753d85e2..0000000000 --- a/tests/regressiontests/forms/localflavor/au.py +++ /dev/null @@ -1,50 +0,0 @@ -from django.contrib.localflavor.au.forms import (AUPostCodeField, - AUPhoneNumberField, AUStateSelect) - -from django.test import SimpleTestCase - - -class AULocalFlavorTests(SimpleTestCase): - def test_AUStateSelect(self): - f = AUStateSelect() - out = u'''''' - self.assertEqual(f.render('state', 'NSW'), out) - - def test_AUPostCodeField(self): - error_format = [u'Enter a 4 digit postcode.'] - valid = { - '1234': '1234', - '2000': '2000', - } - invalid = { - 'abcd': error_format, - '20001': [u'Ensure this value has at most 4 characters (it has 5).'] + error_format, - } - self.assertFieldOutput(AUPostCodeField, valid, invalid) - - def test_AUPhoneNumberField(self): - error_format = [u'Phone numbers must contain 10 digits.'] - valid = { - '1234567890': '1234567890', - '0213456789': '0213456789', - '02 13 45 67 89': '0213456789', - '(02) 1345 6789': '0213456789', - '(02) 1345-6789': '0213456789', - '(02)1345-6789': '0213456789', - '0408 123 456': '0408123456', - } - invalid = { - '123': error_format, - '1800DJANGO': error_format, - } - self.assertFieldOutput(AUPhoneNumberField, valid, invalid) - diff --git a/tests/regressiontests/forms/localflavor/mk.py b/tests/regressiontests/forms/localflavor/mk.py deleted file mode 100644 index 913dfb777d..0000000000 --- a/tests/regressiontests/forms/localflavor/mk.py +++ /dev/null @@ -1,131 +0,0 @@ -from django.contrib.localflavor.mk.forms import ( - MKIdentityCardNumberField, MKMunicipalitySelect, UMCNField) - -from django.test import SimpleTestCase - - -class MKLocalFlavorTests(SimpleTestCase): - - def test_MKIdentityCardNumberField(self): - error_invalid = [u'Identity card numbers must contain either 4 to 7 ' - 'digits or an uppercase letter and 7 digits.'] - valid = { - 'L0018077':'L0018077', - 'A0078315' : 'A0078315', - } - invalid = { - '123': error_invalid, - 'abcdf': error_invalid, - '234390a': error_invalid, - } - self.assertFieldOutput(MKIdentityCardNumberField, valid, invalid) - - def test_MKMunicipalitySelect(self): - f = MKMunicipalitySelect() - out=u'''''' - self.assertEqual(f.render('municipality', 'DL' ), out) - - def test_UMCNField(self): - error_invalid = [u'This field should contain exactly 13 digits.'] - error_checksum = [u'The UMCN is not valid.'] - error_date = [u'The first 7 digits of the UMCN ' - 'must represent a valid past date.'] - valid = { - '2402983450006': '2402983450006', - '2803984430038': '2803984430038', - '1909982045004': '1909982045004', - } - invalid = { - '240298345': error_invalid, - 'abcdefghj': error_invalid, - '2402082450006': error_date, - '3002982450006': error_date, - '2402983450007': error_checksum, - '2402982450006': error_checksum, - } - self.assertFieldOutput(UMCNField, valid, invalid) diff --git a/tests/regressiontests/forms/localflavor/mx.py b/tests/regressiontests/forms/localflavor/mx.py deleted file mode 100644 index 30937de665..0000000000 --- a/tests/regressiontests/forms/localflavor/mx.py +++ /dev/null @@ -1,127 +0,0 @@ -# -*- coding: utf-8 -*- -from django.contrib.localflavor.mx.forms import (MXZipCodeField, MXRFCField, - MXStateSelect, MXCURPField) - -from django.test import SimpleTestCase - - -class MXLocalFlavorTests(SimpleTestCase): - def test_MXStateSelect(self): - f = MXStateSelect() - out = u'''''' - self.assertEqual(f.render('state', 'MIC'), out) - - def test_MXZipCodeField(self): - error_format = [u'Enter a valid zip code in the format XXXXX.'] - valid = { - '58120': u'58120', - '58502': u'58502', - '59310': u'59310', - '99999': u'99999', - } - invalid = { - '17000': error_format, - '18000': error_format, - '19000': error_format, - '00000': error_format, - } - self.assertFieldOutput(MXZipCodeField, valid, invalid) - - def test_MXRFCField(self): - error_format = [u'Enter a valid RFC.'] - error_checksum = [u'Invalid checksum for RFC.'] - valid = { - 'MoFN641205eX5': u'MOFN641205EX5', - 'ICa060120873': u'ICA060120873', - 'eUcG751104rT0': u'EUCG751104RT0', - 'GME08100195A': u'GME08100195A', - 'AA&060524KX5': u'AA&060524KX5', - 'CAÑ0708045P7': u'CAÑ0708045P7', - 'aaa000101aa9': u'AAA000101AA9', - } - invalid = { - 'MED0000000XA': error_format, - '0000000000XA': error_format, - 'AAA000000AA6': error_format, - # Dates - 'XXX880002XXX': error_format, - 'XXX880200XXX': error_format, - 'XXX880132XXX': error_format, - 'XXX880230XXX': error_format, - 'XXX880431XXX': error_format, - # Incorrect checksum - 'MOGR650524E73': error_checksum, - 'HVA7810058F1': error_checksum, - 'MoFN641205eX2': error_checksum, - 'ICa060120871': error_checksum, - 'eUcG751104rT7': error_checksum, - 'GME081001955': error_checksum, - 'AA&060524KX9': error_checksum, - 'CAÑ0708045P2': error_checksum, - } - self.assertFieldOutput(MXRFCField, valid, invalid) - - def test_MXCURPField(self): - error_format = [u'Enter a valid CURP.'] - error_checksum = [u'Invalid checksum for CURP.'] - valid = { - 'AaMG890608HDFLJL00': u'AAMG890608HDFLJL00', - 'BAAd890419HMNRRV07': u'BAAD890419HMNRRV07', - 'VIAA900930MMNClL08': u'VIAA900930MMNCLL08', - 'HEGR891009HMNRRD09': u'HEGR891009HMNRRD09', - 'MARR890512HMNRMN09': u'MARR890512HMNRMN09', - 'MESJ890928HMNZNS00': u'MESJ890928HMNZNS00', - 'BAAA890317HDFRLL03': u'BAAA890317HDFRLL03', - 'TOMA880125HMNRRNO2': u'TOMA880125HMNRRNO2', - 'OOMG890727HMNRSR06': u'OOMG890727HMNRSR06', - 'AAAA000101HDFCCC09': u'AAAA000101HDFCCC09', - } - invalid = { - 'AAAA000000HDFCCC09': error_format, - 'AAAA000000HDFAAA03': error_format, - 'AAAA000000HXXCCC08': error_format, - 'AAAA000000XMNCCC02': error_format, - 'HEGR891009HMNRRD0A': error_format, - 'MARR890512HMNRMN0A': error_format, - 'AaMG890608HDFLJL01': error_checksum, - 'BAAd890419HMNRRV08': error_checksum, - 'VIAA900930MMNClL09': error_checksum, - 'MESJ890928HMNZNS01': error_checksum, - 'BAAA890317HDFRLL04': error_checksum, - 'TOMA880125HMNRRNO3': error_checksum, - 'OOMG890727HMNRSR07': error_checksum, - } - self.assertFieldOutput(MXCURPField, valid, invalid) diff --git a/tests/regressiontests/forms/localflavor/us.py b/tests/regressiontests/forms/localflavor/us.py deleted file mode 100644 index 9b38db5b7c..0000000000 --- a/tests/regressiontests/forms/localflavor/us.py +++ /dev/null @@ -1,129 +0,0 @@ -from django.contrib.localflavor.us.forms import (USZipCodeField, - USPhoneNumberField, USStateField, USStateSelect, USSocialSecurityNumberField) - -from django.test import SimpleTestCase - - -class USLocalFlavorTests(SimpleTestCase): - def test_USStateSelect(self): - f = USStateSelect() - out = u'''''' - self.assertEqual(f.render('state', 'IL'), out) - - def test_USZipCodeField(self): - error_format = [u'Enter a zip code in the format XXXXX or XXXXX-XXXX.'] - valid = { - '60606': '60606', - 60606: '60606', - '04000': '04000', - '60606-1234': '60606-1234', - } - invalid = { - '4000': error_format, - '6060-1234': error_format, - '60606-': error_format, - } - self.assertFieldOutput(USZipCodeField, valid, invalid) - - def test_USPhoneNumberField(self): - error_format = [u'Phone numbers must be in XXX-XXX-XXXX format.'] - valid = { - '312-555-1212': '312-555-1212', - '3125551212': '312-555-1212', - '312 555-1212': '312-555-1212', - '(312) 555-1212': '312-555-1212', - '312 555 1212': '312-555-1212', - '312.555.1212': '312-555-1212', - '312.555-1212': '312-555-1212', - ' (312) 555.1212 ': '312-555-1212', - } - invalid = { - '555-1212': error_format, - '312-55-1212': error_format, - } - self.assertFieldOutput(USPhoneNumberField, valid, invalid) - - def test_USStateField(self): - error_invalid = [u'Enter a U.S. state or territory.'] - valid = { - 'il': 'IL', - 'IL': 'IL', - 'illinois': 'IL', - ' illinois ': 'IL', - } - invalid = { - 60606: error_invalid, - } - self.assertFieldOutput(USStateField, valid, invalid) - - def test_USSocialSecurityNumberField(self): - error_invalid = [u'Enter a valid U.S. Social Security number in XXX-XX-XXXX format.'] - - valid = { - '987-65-4330': '987-65-4330', - '987654330': '987-65-4330', - } - invalid = { - '078-05-1120': error_invalid, - } - self.assertFieldOutput(USSocialSecurityNumberField, valid, invalid) diff --git a/tests/regressiontests/forms/localflavortests.py b/tests/regressiontests/forms/localflavortests.py deleted file mode 100644 index 6a3fb2322e..0000000000 --- a/tests/regressiontests/forms/localflavortests.py +++ /dev/null @@ -1,42 +0,0 @@ -from localflavor.ar import ARLocalFlavorTests -from localflavor.at import ATLocalFlavorTests -from localflavor.au import AULocalFlavorTests -from localflavor.be import BELocalFlavorTests -from localflavor.br import BRLocalFlavorTests -from localflavor.ca import CALocalFlavorTests -from localflavor.ch import CHLocalFlavorTests -from localflavor.cl import CLLocalFlavorTests -from localflavor.cz import CZLocalFlavorTests -from localflavor.cn import CNLocalFlavorTests -from localflavor.co import COLocalFlavorTests -from localflavor.de import DELocalFlavorTests -from localflavor.es import ESLocalFlavorTests -from localflavor.ec import ECLocalFlavorTests -from localflavor.fi import FILocalFlavorTests -from localflavor.fr import FRLocalFlavorTests -from localflavor.gb import GBLocalFlavorTests -from localflavor.generic import GenericLocalFlavorTests -from localflavor.hr import HRLocalFlavorTests -from localflavor.id import IDLocalFlavorTests -from localflavor.ie import IELocalFlavorTests -from localflavor.il import ILLocalFlavorTests -from localflavor.is_ import ISLocalFlavorTests -from localflavor.in_ import INLocalFlavorTests -from localflavor.it import ITLocalFlavorTests -from localflavor.jp import JPLocalFlavorTests -from localflavor.kw import KWLocalFlavorTests -from localflavor.mk import MKLocalFlavorTests -from localflavor.mx import MXLocalFlavorTests -from localflavor.nl import NLLocalFlavorTests -from localflavor.pl import PLLocalFlavorTests -from localflavor.pt import PTLocalFlavorTests -from localflavor.py import PYLocalFlavorTests -from localflavor.ro import ROLocalFlavorTests -from localflavor.ru import RULocalFlavorTests -from localflavor.se import SELocalFlavorTests -from localflavor.sk import SKLocalFlavorTests -from localflavor.tr import TRLocalFlavorTests -from localflavor.us import USLocalFlavorTests -from localflavor.uy import UYLocalFlavorTests -from localflavor.za import ZALocalFlavorTests - diff --git a/tests/regressiontests/forms/tests/__init__.py b/tests/regressiontests/forms/tests/__init__.py index 9570835aa9..1b615c4583 100644 --- a/tests/regressiontests/forms/tests/__init__.py +++ b/tests/regressiontests/forms/tests/__init__.py @@ -10,47 +10,3 @@ from regressions import * from util import * from validators import TestFieldWithValidators from widgets import * - -from regressiontests.forms.localflavortests import ( - ARLocalFlavorTests, - ATLocalFlavorTests, - AULocalFlavorTests, - BELocalFlavorTests, - BRLocalFlavorTests, - CALocalFlavorTests, - CHLocalFlavorTests, - CLLocalFlavorTests, - CNLocalFlavorTests, - COLocalFlavorTests, - CZLocalFlavorTests, - DELocalFlavorTests, - ECLocalFlavorTests, - ESLocalFlavorTests, - FILocalFlavorTests, - FRLocalFlavorTests, - GBLocalFlavorTests, - GenericLocalFlavorTests, - HRLocalFlavorTests, - IDLocalFlavorTests, - IELocalFlavorTests, - ILLocalFlavorTests, - ISLocalFlavorTests, - INLocalFlavorTests, - ITLocalFlavorTests, - JPLocalFlavorTests, - KWLocalFlavorTests, - MKLocalFlavorTests, - MXLocalFlavorTests, - NLLocalFlavorTests, - PLLocalFlavorTests, - PTLocalFlavorTests, - PYLocalFlavorTests, - ROLocalFlavorTests, - RULocalFlavorTests, - SELocalFlavorTests, - SKLocalFlavorTests, - TRLocalFlavorTests, - USLocalFlavorTests, - UYLocalFlavorTests, - ZALocalFlavorTests, -) diff --git a/tests/regressiontests/localflavor/ar/__init__.py b/tests/regressiontests/localflavor/ar/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/regressiontests/forms/localflavor/ar.py b/tests/regressiontests/localflavor/ar/tests.py similarity index 100% rename from tests/regressiontests/forms/localflavor/ar.py rename to tests/regressiontests/localflavor/ar/tests.py diff --git a/tests/regressiontests/localflavor/at/__init__.py b/tests/regressiontests/localflavor/at/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/regressiontests/forms/localflavor/at.py b/tests/regressiontests/localflavor/at/tests.py similarity index 100% rename from tests/regressiontests/forms/localflavor/at.py rename to tests/regressiontests/localflavor/at/tests.py diff --git a/tests/regressiontests/localflavor/au/tests.py b/tests/regressiontests/localflavor/au/tests.py index 1f462d579f..bdfaa2b799 100644 --- a/tests/regressiontests/localflavor/au/tests.py +++ b/tests/regressiontests/localflavor/au/tests.py @@ -1,6 +1,9 @@ import re -from django.test import TestCase +from django.test import SimpleTestCase +from django.contrib.localflavor.au.forms import (AUPostCodeField, + AUPhoneNumberField, AUStateSelect) + from forms import AustralianPlaceForm SELECTED_OPTION_PATTERN = r'