| 1517 | |
| 1518 | # ARProvinceField ############################################################# |
| 1519 | |
| 1520 | >>> from django.contrib.localflavor.ar.forms import ARProvinceSelect |
| 1521 | >>> f = ARProvinceSelect() |
| 1522 | >>> f.render('provincias', 'A') |
| 1523 | u'<select name="provincias">\n<option value="B">Buenos Aires</option>\n<option value="K">Catamarca</option>\n<option value="H">Chaco</option>\n<option value="U">Chubut</option>\n<option value="C">Ciudad Aut\xf3noma de Buenos Aires</option>\n<option value="X">C\xf3rdoba</option>\n<option value="W">Corrientes</option>\n<option value="E">Entre R\xedos</option>\n<option value="P">Formosa</option>\n<option value="Y">Jujuy</option>\n<option value="L">La Pampa</option>\n<option value="F">La Rioja</option>\n<option value="M">Mendoza</option>\n<option value="N">Misiones</option>\n<option value="Q">Neuqu\xe9n</option>\n<option value="R">R\xedo Negro</option>\n<option value="A" selected="selected">Salta</option>\n<option value="J">San Juan</option>\n<option value="D">San Luis</option>\n<option value="Z">Santa Cruz</option>\n<option value="S">Santa Fe</option>\n<option value="G">Santiago del Estero</option>\n<option value="V">Tierra del Fuego, Ant\xe1rtida e Islas del Atl\xe1ntico Sur</option>\n<option value="T">Tucum\xe1n</option>\n</select>' |
| 1524 | |
| 1525 | # ARPostalCodeField ########################################################### |
| 1526 | |
| 1527 | >>> from django.contrib.localflavor.ar.forms import ARPostalCodeField |
| 1528 | >>> f = ARPostalCodeField() |
| 1529 | >>> f.clean('5000') |
| 1530 | u'5000' |
| 1531 | >>> f.clean('C1064AAB') |
| 1532 | u'C1064AAB' |
| 1533 | >>> f.clean('c1064AAB') |
| 1534 | u'C1064AAB' |
| 1535 | >>> f.clean('C1064aab') |
| 1536 | u'C1064AAB' |
| 1537 | >>> f.clean(u'4400') |
| 1538 | u'4400' |
| 1539 | >>> f.clean(u'C1064AAB') |
| 1540 | u'C1064AAB' |
| 1541 | >>> f.clean('C1064AABB') |
| 1542 | Traceback (most recent call last): |
| 1543 | ... |
| 1544 | ValidationError: [u'Ensure this value has at most 8 characters (it has 9).'] |
| 1545 | >>> f.clean('C1064AA') |
| 1546 | Traceback (most recent call last): |
| 1547 | ... |
| 1548 | ValidationError: [u'Enter a postal code in the format NNNN or ANNNNAAA.'] |
| 1549 | >>> f.clean('C106AAB') |
| 1550 | Traceback (most recent call last): |
| 1551 | ... |
| 1552 | ValidationError: [u'Enter a postal code in the format NNNN or ANNNNAAA.'] |
| 1553 | >>> f.clean('106AAB') |
| 1554 | Traceback (most recent call last): |
| 1555 | ... |
| 1556 | ValidationError: [u'Enter a postal code in the format NNNN or ANNNNAAA.'] |
| 1557 | >>> f.clean('500') |
| 1558 | Traceback (most recent call last): |
| 1559 | ... |
| 1560 | ValidationError: [u'Ensure this value has at least 4 characters (it has 3).'] |
| 1561 | >>> f.clean('5PPP') |
| 1562 | Traceback (most recent call last): |
| 1563 | ... |
| 1564 | ValidationError: [u'Enter a postal code in the format NNNN or ANNNNAAA.'] |
| 1565 | >>> f.clean(None) |
| 1566 | Traceback (most recent call last): |
| 1567 | ... |
| 1568 | ValidationError: [u'This field is required.'] |
| 1569 | >>> f.clean('') |
| 1570 | Traceback (most recent call last): |
| 1571 | ... |
| 1572 | ValidationError: [u'This field is required.'] |
| 1573 | >>> f.clean(u'') |
| 1574 | Traceback (most recent call last): |
| 1575 | ... |
| 1576 | ValidationError: [u'This field is required.'] |
| 1577 | |
| 1578 | >>> f = ARPostalCodeField(required=False) |
| 1579 | >>> f.clean('5000') |
| 1580 | u'5000' |
| 1581 | >>> f.clean('C1064AAB') |
| 1582 | u'C1064AAB' |
| 1583 | >>> f.clean('c1064AAB') |
| 1584 | u'C1064AAB' |
| 1585 | >>> f.clean('C1064aab') |
| 1586 | u'C1064AAB' |
| 1587 | >>> f.clean(u'4400') |
| 1588 | u'4400' |
| 1589 | >>> f.clean(u'C1064AAB') |
| 1590 | u'C1064AAB' |
| 1591 | >>> f.clean('C1064AABB') |
| 1592 | Traceback (most recent call last): |
| 1593 | ... |
| 1594 | ValidationError: [u'Ensure this value has at most 8 characters (it has 9).'] |
| 1595 | >>> f.clean('C1064AA') |
| 1596 | Traceback (most recent call last): |
| 1597 | ... |
| 1598 | ValidationError: [u'Enter a postal code in the format NNNN or ANNNNAAA.'] |
| 1599 | >>> f.clean('C106AAB') |
| 1600 | Traceback (most recent call last): |
| 1601 | ... |
| 1602 | ValidationError: [u'Enter a postal code in the format NNNN or ANNNNAAA.'] |
| 1603 | >>> f.clean('106AAB') |
| 1604 | Traceback (most recent call last): |
| 1605 | ... |
| 1606 | ValidationError: [u'Enter a postal code in the format NNNN or ANNNNAAA.'] |
| 1607 | >>> f.clean('500') |
| 1608 | Traceback (most recent call last): |
| 1609 | ... |
| 1610 | ValidationError: [u'Ensure this value has at least 4 characters (it has 3).'] |
| 1611 | >>> f.clean('5PPP') |
| 1612 | Traceback (most recent call last): |
| 1613 | ... |
| 1614 | ValidationError: [u'Enter a postal code in the format NNNN or ANNNNAAA.'] |
| 1615 | >>> f.clean(None) |
| 1616 | u'' |
| 1617 | >>> f.clean('') |
| 1618 | u'' |
| 1619 | >>> f.clean(u'') |
| 1620 | u'' |
| 1621 | |
| 1622 | # ARDNIField ################################################################## |
| 1623 | |
| 1624 | >>> from django.contrib.localflavor.ar.forms import ARDNIField |
| 1625 | >>> f = ARDNIField() |
| 1626 | >>> f.clean('20123456') |
| 1627 | u'20123456' |
| 1628 | >>> f.clean('20.123.456') |
| 1629 | u'20123456' |
| 1630 | >>> f.clean('9123456') |
| 1631 | u'9123456' |
| 1632 | >>> f.clean('9.123.456') |
| 1633 | u'9123456' |
| 1634 | >>> f.clean(u'20123456') |
| 1635 | u'20123456' |
| 1636 | >>> f.clean(u'20.123.456') |
| 1637 | u'20123456' |
| 1638 | >>> f.clean('20.123456') |
| 1639 | u'20123456' |
| 1640 | >>> f.clean('101234566') |
| 1641 | Traceback (most recent call last): |
| 1642 | ... |
| 1643 | ValidationError: [u'This field requires 7 or 8 digits.'] |
| 1644 | >>> f.clean('W0123456') |
| 1645 | Traceback (most recent call last): |
| 1646 | ... |
| 1647 | ValidationError: [u'This field requires only numbers.'] |
| 1648 | >>> f.clean('10,123,456') |
| 1649 | Traceback (most recent call last): |
| 1650 | ... |
| 1651 | ValidationError: [u'This field requires only numbers.'] |
| 1652 | >>> f.clean(None) |
| 1653 | Traceback (most recent call last): |
| 1654 | ... |
| 1655 | ValidationError: [u'This field is required.'] |
| 1656 | >>> f.clean('') |
| 1657 | Traceback (most recent call last): |
| 1658 | ... |
| 1659 | ValidationError: [u'This field is required.'] |
| 1660 | >>> f.clean(u'') |
| 1661 | Traceback (most recent call last): |
| 1662 | ... |
| 1663 | ValidationError: [u'This field is required.'] |
| 1664 | |
| 1665 | >>> f = ARDNIField(required=False) |
| 1666 | >>> f.clean('20123456') |
| 1667 | u'20123456' |
| 1668 | >>> f.clean('20.123.456') |
| 1669 | u'20123456' |
| 1670 | >>> f.clean('9123456') |
| 1671 | u'9123456' |
| 1672 | >>> f.clean('9.123.456') |
| 1673 | u'9123456' |
| 1674 | >>> f.clean(u'20123456') |
| 1675 | u'20123456' |
| 1676 | >>> f.clean(u'20.123.456') |
| 1677 | u'20123456' |
| 1678 | >>> f.clean('20.123456') |
| 1679 | u'20123456' |
| 1680 | >>> f.clean('101234566') |
| 1681 | Traceback (most recent call last): |
| 1682 | ... |
| 1683 | ValidationError: [u'This field requires 7 or 8 digits.'] |
| 1684 | >>> f.clean('W0123456') |
| 1685 | Traceback (most recent call last): |
| 1686 | ... |
| 1687 | ValidationError: [u'This field requires only numbers.'] |
| 1688 | >>> f.clean('10,123,456') |
| 1689 | Traceback (most recent call last): |
| 1690 | ... |
| 1691 | ValidationError: [u'This field requires only numbers.'] |
| 1692 | >>> f.clean(None) |
| 1693 | u'' |
| 1694 | >>> f.clean('') |
| 1695 | u'' |
| 1696 | >>> f.clean(u'') |
| 1697 | u'' |
| 1698 | |
| 1699 | # ARCUITField ################################################################# |
| 1700 | |
| 1701 | >>> from django.contrib.localflavor.ar.forms import ARCUITField |
| 1702 | >>> f = ARCUITField() |
| 1703 | >>> f.clean('20-10123456-9') |
| 1704 | u'20-10123456-9' |
| 1705 | >>> f.clean(u'20-10123456-9') |
| 1706 | u'20-10123456-9' |
| 1707 | >>> f.clean('27-10345678-4') |
| 1708 | u'27-10345678-4' |
| 1709 | >>> f.clean('20101234569') |
| 1710 | u'20-10123456-9' |
| 1711 | >>> f.clean('27103456784') |
| 1712 | u'27-10345678-4' |
| 1713 | >>> f.clean('2-10123456-9') |
| 1714 | Traceback (most recent call last): |
| 1715 | ... |
| 1716 | ValidationError: [u'Enter a valid CUIT in XX-XXXXXXXX-X or XXXXXXXXXXXX format.'] |
| 1717 | >>> f.clean('210123456-9') |
| 1718 | Traceback (most recent call last): |
| 1719 | ... |
| 1720 | ValidationError: [u'Enter a valid CUIT in XX-XXXXXXXX-X or XXXXXXXXXXXX format.'] |
| 1721 | >>> f.clean('20-10123456') |
| 1722 | Traceback (most recent call last): |
| 1723 | ... |
| 1724 | ValidationError: [u'Enter a valid CUIT in XX-XXXXXXXX-X or XXXXXXXXXXXX format.'] |
| 1725 | >>> f.clean('20-10123456-') |
| 1726 | Traceback (most recent call last): |
| 1727 | ... |
| 1728 | ValidationError: [u'Enter a valid CUIT in XX-XXXXXXXX-X or XXXXXXXXXXXX format.'] |
| 1729 | >>> f.clean('20-10123456-5') |
| 1730 | Traceback (most recent call last): |
| 1731 | ... |
| 1732 | ValidationError: [u'Invalid CUIT.'] |
| 1733 | >>> f.clean(u'2-10123456-9') |
| 1734 | Traceback (most recent call last): |
| 1735 | ... |
| 1736 | ValidationError: [u'Enter a valid CUIT in XX-XXXXXXXX-X or XXXXXXXXXXXX format.'] |
| 1737 | >>> f.clean('27-10345678-1') |
| 1738 | Traceback (most recent call last): |
| 1739 | ... |
| 1740 | ValidationError: [u'Invalid CUIT.'] |
| 1741 | >>> f.clean(u'27-10345678-1') |
| 1742 | Traceback (most recent call last): |
| 1743 | ... |
| 1744 | ValidationError: [u'Invalid CUIT.'] |
| 1745 | >>> f.clean(None) |
| 1746 | Traceback (most recent call last): |
| 1747 | ... |
| 1748 | ValidationError: [u'This field is required.'] |
| 1749 | >>> f.clean('') |
| 1750 | Traceback (most recent call last): |
| 1751 | ... |
| 1752 | ValidationError: [u'This field is required.'] |
| 1753 | >>> f.clean(u'') |
| 1754 | Traceback (most recent call last): |
| 1755 | ... |
| 1756 | ValidationError: [u'This field is required.'] |
| 1757 | |
| 1758 | >>> f = ARCUITField(required=False) |
| 1759 | >>> f.clean('20-10123456-9') |
| 1760 | u'20-10123456-9' |
| 1761 | >>> f.clean(u'20-10123456-9') |
| 1762 | u'20-10123456-9' |
| 1763 | >>> f.clean('27-10345678-4') |
| 1764 | u'27-10345678-4' |
| 1765 | >>> f.clean('20101234569') |
| 1766 | u'20-10123456-9' |
| 1767 | >>> f.clean('27103456784') |
| 1768 | u'27-10345678-4' |
| 1769 | >>> f.clean('2-10123456-9') |
| 1770 | Traceback (most recent call last): |
| 1771 | ... |
| 1772 | ValidationError: [u'Enter a valid CUIT in XX-XXXXXXXX-X or XXXXXXXXXXXX format.'] |
| 1773 | >>> f.clean('210123456-9') |
| 1774 | Traceback (most recent call last): |
| 1775 | ... |
| 1776 | ValidationError: [u'Enter a valid CUIT in XX-XXXXXXXX-X or XXXXXXXXXXXX format.'] |
| 1777 | >>> f.clean('20-10123456') |
| 1778 | Traceback (most recent call last): |
| 1779 | ... |
| 1780 | ValidationError: [u'Enter a valid CUIT in XX-XXXXXXXX-X or XXXXXXXXXXXX format.'] |
| 1781 | >>> f.clean('20-10123456-') |
| 1782 | Traceback (most recent call last): |
| 1783 | ... |
| 1784 | ValidationError: [u'Enter a valid CUIT in XX-XXXXXXXX-X or XXXXXXXXXXXX format.'] |
| 1785 | >>> f.clean('20-10123456-5') |
| 1786 | Traceback (most recent call last): |
| 1787 | ... |
| 1788 | ValidationError: [u'Invalid CUIT.'] |
| 1789 | >>> f.clean(u'2-10123456-9') |
| 1790 | Traceback (most recent call last): |
| 1791 | ... |
| 1792 | ValidationError: [u'Enter a valid CUIT in XX-XXXXXXXX-X or XXXXXXXXXXXX format.'] |
| 1793 | >>> f.clean('27-10345678-1') |
| 1794 | Traceback (most recent call last): |
| 1795 | ... |
| 1796 | ValidationError: [u'Invalid CUIT.'] |
| 1797 | >>> f.clean(u'27-10345678-1') |
| 1798 | Traceback (most recent call last): |
| 1799 | ... |
| 1800 | ValidationError: [u'Invalid CUIT.'] |
| 1801 | >>> f.clean(None) |
| 1802 | u'' |
| 1803 | >>> f.clean('') |
| 1804 | u'' |
| 1805 | >>> f.clean(u'') |
| 1806 | u'' |