<commit_before>from django.contrib.localflavor.mk.forms import (
    MKIdentityCardNumberField, MKMunicipalitySelect, UMCNField)

from utils import LocalFlavorTestCase


class MKLocalFlavorTests(LocalFlavorTestCase):

    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'''<select name="municipality">
<option value="AD">Aerodrom</option>
<option value="AR">Ara\u010dinovo</option>
<option value="BR">Berovo</option>
<option value="TL">Bitola</option>
<option value="BG">Bogdanci</option>
<option value="VJ">Bogovinje</option>
<option value="BS">Bosilovo</option>
<option value="BN">Brvenica</option>
<option value="BU">Butel</option>
<option value="VA">Valandovo</option><commit_msg>Fixed broken test introduced in r16385.<commit_after>from django.contrib.localflavor.mk.forms import (
    MKIdentityCardNumberField, MKMunicipalitySelect, UMCNField)

from utils import LocalFlavorTestCase


class MKLocalFlavorTests(LocalFlavorTestCase):

    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'''<select name="municipality">
<option value="AD">Aerodrom</option>
<option value="AR">Ara\u010dinovo</option>
<option value="BR">Berovo</option>
<option value="TL">Bitola</option>
<option value="BG">Bogdanci</option>
<option value="VJ">Bogovinje</option>
<option value="BS">Bosilovo</option>
<option value="BN">Brvenica</option>
<option value="BU">Butel</option>
<option value="VA">Valandovo</option>
{'fraction_non_alphanumeric': 0.1264135702746365, 'fraction_numerical': 0.036752827140549275, 'mean_word_length': 3.700189753320683, 'pattern_counts': {'":': 0, '<': 45, '<?xml version=': 0, '>': 45, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6879655', 'n_tokens_mistral': 851, 'n_tokens_neox': 768, 'n_words': 148}