- Timestamp:
- 22 Dec 2014, 13:49:14 (10 years ago)
- Location:
- main/waeup.ikoba/branches/uli-payments/src/waeup/ikoba/payments
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/branches/uli-payments/src/waeup/ikoba/payments/currencies.py
r12248 r12294 1 1 """Currencies 2 2 """ 3 from waeup.ikoba.interfaces import MessageFactory as _ 4 from waeup.ikoba.interfaces import SimpleIkobaVocabulary 5 3 6 #: Currencies according to ISO 4217 4 7 #: … … 18 21 #: 19 22 ISO_4217_CURRENCIES = { 20 'AED': ('UNITED ARAB EMIRATES', 'UAE Dirham', 2, '784'),21 'AFN': ('AFGHANISTAN', 'Afghani', 2, '971'),22 'ALL': ('ALBANIA', 'Lek', 2, '008'),23 'AMD': ('ARMENIA', 'Armenian Dram', 2, '051'),23 'AED': ('UNITED ARAB EMIRATES', _('UAE Dirham'), 2, '784'), 24 'AFN': ('AFGHANISTAN', _('Afghani'), 2, '971'), 25 'ALL': ('ALBANIA', _('Lek'), 2, '008'), 26 'AMD': ('ARMENIA', _('Armenian Dram'), 2, '051'), 24 27 'ANG': ('SINT MAARTEN (DUTCH PART)', 25 'Netherlands Antillean Guilder',28 _('Netherlands Antillean Guilder'), 26 29 2, 27 30 '532'), 28 'AOA': ('ANGOLA', 'Kwanza', 2, '973'), 29 'ARS': ('ARGENTINA', 'Argentine Peso', 2, '032'), 30 'AUD': ('TUVALU', 'Australian Dollar', 2, '036'), 31 'AWG': ('ARUBA', 'Aruban Florin', 2, '533'), 32 'AZN': ('AZERBAIJAN', 'Azerbaijanian Manat', 2, '944'), 33 'BAM': ('BOSNIA AND HERZEGOVINA', 'Convertible Mark', 2, '977'), 34 'BBD': ('BARBADOS', 'Barbados Dollar', 2, '052'), 35 'BDT': ('BANGLADESH', 'Taka', 2, '050'), 36 'BGN': ('BULGARIA', 'Bulgarian Lev', 2, '975'), 37 'BHD': ('BAHRAIN', 'Bahraini Dinar', 3, '048'), 38 'BIF': ('BURUNDI', 'Burundi Franc', 0, '108'), 39 'BMD': ('BERMUDA', 'Bermudian Dollar', 2, '060'), 40 'BND': ('BRUNEI DARUSSALAM', 'Brunei Dollar', 2, '096'), 41 'BOB': ('BOLIVIA, PLURINATIONAL STATE OF', 'Boliviano', 2, '068'), 42 'BOV': ('BOLIVIA, PLURINATIONAL STATE OF', 'Mvdol', 2, '984'), 43 'BRL': ('BRAZIL', 'Brazilian Real', 2, '986'), 44 'BSD': ('BAHAMAS', 'Bahamian Dollar', 2, '044'), 45 'BTN': ('BHUTAN', 'Ngultrum', 2, '064'), 46 'BWP': ('BOTSWANA', 'Pula', 2, '072'), 47 'BYR': ('BELARUS', 'Belarussian Ruble', 0, '974'), 48 'BZD': ('BELIZE', 'Belize Dollar', 2, '084'), 49 'CAD': ('CANADA', 'Canadian Dollar', 2, '124'), 50 'CDF': ('CONGO, DEMOCRATIC REPUBLIC OF THE ', 'Congolese Franc', 2, '976'), 51 'CHE': ('SWITZERLAND', 'WIR Euro', 2, '947'), 52 'CHF': ('SWITZERLAND', 'Swiss Franc', 2, '756'), 53 'CHW': ('SWITZERLAND', 'WIR Franc', 2, '948'), 54 'CLF': ('CHILE', 'Unidad de Fomento', 4, '990'), 55 'CLP': ('CHILE', 'Chilean Peso', 0, '152'), 56 'CNY': ('CHINA', 'Yuan Renminbi', 2, '156'), 57 'COP': ('COLOMBIA', 'Colombian Peso', 2, '170'), 58 'COU': ('COLOMBIA', 'Unidad de Valor Real', 2, '970'), 59 'CRC': ('COSTA RICA', 'Costa Rican Colon', 2, '188'), 60 'CUC': ('CUBA', 'Peso Convertible', 2, '931'), 61 'CUP': ('CUBA', 'Cuban Peso', 2, '192'), 62 'CVE': ('CABO VERDE', 'Cabo Verde Escudo', 2, '132'), 63 'CZK': ('CZECH REPUBLIC', 'Czech Koruna', 2, '203'), 64 'DJF': ('DJIBOUTI', 'Djibouti Franc', 0, '262'), 65 'DKK': ('GREENLAND', 'Danish Krone', 2, '208'), 66 'DOP': ('DOMINICAN REPUBLIC', 'Dominican Peso', 2, '214'), 67 'DZD': ('ALGERIA', 'Algerian Dinar', 2, '012'), 68 'EGP': ('EGYPT', 'Egyptian Pound', 2, '818'), 69 'ERN': ('ERITREA', 'Nakfa', 2, '232'), 70 'ETB': ('ETHIOPIA', 'Ethiopian Birr', 2, '230'), 71 'EUR': ('SPAIN', 'Euro', 2, '978'), 72 'FJD': ('FIJI', 'Fiji Dollar', 2, '242'), 73 'FKP': ('FALKLAND ISLANDS (MALVINAS)', 'Falkland Islands Pound', 2, '238'), 74 'GBP': ('UNITED KINGDOM', 'Pound Sterling', 2, '826'), 75 'GEL': ('GEORGIA', 'Lari', 2, '981'), 76 'GHS': ('GHANA', 'Ghana Cedi', 2, '936'), 77 'GIP': ('GIBRALTAR', 'Gibraltar Pound', 2, '292'), 78 'GMD': ('GAMBIA', 'Dalasi', 2, '270'), 79 'GNF': ('GUINEA', 'Guinea Franc', 0, '324'), 80 'GTQ': ('GUATEMALA', 'Quetzal', 2, '320'), 81 'GYD': ('GUYANA', 'Guyana Dollar', 2, '328'), 82 'HKD': ('HONG KONG', 'Hong Kong Dollar', 2, '344'), 83 'HNL': ('HONDURAS', 'Lempira', 2, '340'), 84 'HRK': ('CROATIA', 'Croatian Kuna', 2, '191'), 85 'HTG': ('HAITI', 'Gourde', 2, '332'), 86 'HUF': ('HUNGARY', 'Forint', 2, '348'), 87 'IDR': ('INDONESIA', 'Rupiah', 2, '360'), 88 'ILS': ('ISRAEL', 'New Israeli Sheqel', 2, '376'), 89 'INR': ('INDIA', 'Indian Rupee', 2, '356'), 90 'IQD': ('IRAQ', 'Iraqi Dinar', 3, '368'), 91 'IRR': ('IRAN, ISLAMIC REPUBLIC OF', 'Iranian Rial', 2, '364'), 92 'ISK': ('ICELAND', 'Iceland Krona', 0, '352'), 93 'JMD': ('JAMAICA', 'Jamaican Dollar', 2, '388'), 94 'JOD': ('JORDAN', 'Jordanian Dinar', 3, '400'), 95 'JPY': ('JAPAN', 'Yen', 0, '392'), 96 'KES': ('KENYA', 'Kenyan Shilling', 2, '404'), 97 'KGS': ('KYRGYZSTAN', 'Som', 2, '417'), 98 'KHR': ('CAMBODIA', 'Riel', 2, '116'), 99 'KMF': ('COMOROS', 'Comoro Franc', 0, '174'), 31 'AOA': ('ANGOLA', _('Kwanza'), 2, '973'), 32 'ARS': ('ARGENTINA', _('Argentine Peso'), 2, '032'), 33 'AUD': ('TUVALU', _('Australian Dollar'), 2, '036'), 34 'AWG': ('ARUBA', _('Aruban Florin'), 2, '533'), 35 'AZN': ('AZERBAIJAN', _('Azerbaijanian Manat'), 2, '944'), 36 'BAM': ('BOSNIA AND HERZEGOVINA', _('Convertible Mark'), 2, '977'), 37 'BBD': ('BARBADOS', _('Barbados Dollar'), 2, '052'), 38 'BDT': ('BANGLADESH', _('Taka'), 2, '050'), 39 'BGN': ('BULGARIA', _('Bulgarian Lev'), 2, '975'), 40 'BHD': ('BAHRAIN', _('Bahraini Dinar'), 3, '048'), 41 'BIF': ('BURUNDI', _('Burundi Franc'), 0, '108'), 42 'BMD': ('BERMUDA', _('Bermudian Dollar'), 2, '060'), 43 'BND': ('BRUNEI DARUSSALAM', _('Brunei Dollar'), 2, '096'), 44 'BOB': ('BOLIVIA, PLURINATIONAL STATE OF', _('Boliviano'), 2, '068'), 45 'BOV': ('BOLIVIA, PLURINATIONAL STATE OF', _('Mvdol'), 2, '984'), 46 'BRL': ('BRAZIL', _('Brazilian Real'), 2, '986'), 47 'BSD': ('BAHAMAS', _('Bahamian Dollar'), 2, '044'), 48 'BTN': ('BHUTAN', _('Ngultrum'), 2, '064'), 49 'BWP': ('BOTSWANA', _('Pula'), 2, '072'), 50 'BYR': ('BELARUS', _('Belarussian Ruble'), 0, '974'), 51 'BZD': ('BELIZE', _('Belize Dollar'), 2, '084'), 52 'CAD': ('CANADA', _('Canadian Dollar'), 2, '124'), 53 'CDF': ('CONGO, DEMOCRATIC REPUBLIC OF THE ', 54 _('Congolese Franc'), 55 2, 56 '976'), 57 'CHE': ('SWITZERLAND', _('WIR Euro'), 2, '947'), 58 'CHF': ('SWITZERLAND', _('Swiss Franc'), 2, '756'), 59 'CHW': ('SWITZERLAND', _('WIR Franc'), 2, '948'), 60 'CLF': ('CHILE', _('Unidad de Fomento'), 4, '990'), 61 'CLP': ('CHILE', _('Chilean Peso'), 0, '152'), 62 'CNY': ('CHINA', _('Yuan Renminbi'), 2, '156'), 63 'COP': ('COLOMBIA', _('Colombian Peso'), 2, '170'), 64 'COU': ('COLOMBIA', _('Unidad de Valor Real'), 2, '970'), 65 'CRC': ('COSTA RICA', _('Costa Rican Colon'), 2, '188'), 66 'CUC': ('CUBA', _('Peso Convertible'), 2, '931'), 67 'CUP': ('CUBA', _('Cuban Peso'), 2, '192'), 68 'CVE': ('CABO VERDE', _('Cabo Verde Escudo'), 2, '132'), 69 'CZK': ('CZECH REPUBLIC', _('Czech Koruna'), 2, '203'), 70 'DJF': ('DJIBOUTI', _('Djibouti Franc'), 0, '262'), 71 'DKK': ('GREENLAND', _('Danish Krone'), 2, '208'), 72 'DOP': ('DOMINICAN REPUBLIC', _('Dominican Peso'), 2, '214'), 73 'DZD': ('ALGERIA', _('Algerian Dinar'), 2, '012'), 74 'EGP': ('EGYPT', _('Egyptian Pound'), 2, '818'), 75 'ERN': ('ERITREA', _('-Nakfa'), 2, '232'), 76 'ETB': ('ETHIOPIA', _('Ethiopian Birr'), 2, '230'), 77 'EUR': ('SPAIN', _('Euro'), 2, '978'), 78 'FJD': ('FIJI', _('Fiji Dollar'), 2, '242'), 79 'FKP': ('FALKLAND ISLANDS (MALVINAS)', 80 _('Falkland Islands Pound'), 81 2, 82 '238'), 83 'GBP': ('UNITED KINGDOM', _('Pound Sterling'), 2, '826'), 84 'GEL': ('GEORGIA', _('Lari'), 2, '981'), 85 'GHS': ('GHANA', _('Ghana Cedi'), 2, '936'), 86 'GIP': ('GIBRALTAR', _('Gibraltar Pound'), 2, '292'), 87 'GMD': ('GAMBIA', _('Dalasi'), 2, '270'), 88 'GNF': ('GUINEA', _('Guinea Franc'), 0, '324'), 89 'GTQ': ('GUATEMALA', _('Quetzal'), 2, '320'), 90 'GYD': ('GUYANA', _('Guyana Dollar'), 2, '328'), 91 'HKD': ('HONG KONG', _('Hong Kong Dollar'), 2, '344'), 92 'HNL': ('HONDURAS', _('Lempira'), 2, '340'), 93 'HRK': ('CROATIA', _('Croatian Kuna'), 2, '191'), 94 'HTG': ('HAITI', _('Gourde'), 2, '332'), 95 'HUF': ('HUNGARY', _('Forint'), 2, '348'), 96 'IDR': ('INDONESIA', _('Rupiah'), 2, '360'), 97 'ILS': ('ISRAEL', _('New Israeli Sheqel'), 2, '376'), 98 'INR': ('INDIA', _('Indian Rupee'), 2, '356'), 99 'IQD': ('IRAQ', _('Iraqi Dinar'), 3, '368'), 100 'IRR': ('IRAN, ISLAMIC REPUBLIC OF', _('Iranian Rial'), 2, '364'), 101 'ISK': ('ICELAND', _('Iceland Krona'), 0, '352'), 102 'JMD': ('JAMAICA', _('Jamaican Dollar'), 2, '388'), 103 'JOD': ('JORDAN', _('Jordanian Dinar'), 3, '400'), 104 'JPY': ('JAPAN', _('Yen'), 0, '392'), 105 'KES': ('KENYA', _('Kenyan Shilling'), 2, '404'), 106 'KGS': ('KYRGYZSTAN', _('Som'), 2, '417'), 107 'KHR': ('CAMBODIA', _('Riel'), 2, '116'), 108 'KMF': ('COMOROS', _('Comoro Franc'), 0, '174'), 100 109 'KPW': (u"KOREA, DEMOCRATIC PEOPLE'S REPUBLIC OF", 101 'North Korean Won',110 _('North Korean Won'), 102 111 2, 103 112 '408'), 104 'KRW': ('KOREA, REPUBLIC OF', 'Won', 0, '410'), 105 'KWD': ('KUWAIT', 'Kuwaiti Dinar', 3, '414'), 106 'KYD': ('CAYMAN ISLANDS', 'Cayman Islands Dollar', 2, '136'), 107 'KZT': ('KAZAKHSTAN', 'Tenge', 2, '398'), 108 'LAK': (u"LAO PEOPLE'S DEMOCRATIC REPUBLIC", 'Kip', 2, '418'), 109 'LBP': ('LEBANON', 'Lebanese Pound', 2, '422'), 110 'LKR': ('SRI LANKA', 'Sri Lanka Rupee', 2, '144'), 111 'LRD': ('LIBERIA', 'Liberian Dollar', 2, '430'), 112 'LSL': ('LESOTHO', 'Loti', 2, '426'), 113 'LTL': ('LITHUANIA', 'Lithuanian Litas', 2, '440'), 114 'LYD': ('LIBYA', 'Libyan Dinar', 3, '434'), 115 'MAD': ('WESTERN SAHARA', 'Moroccan Dirham', 2, '504'), 116 'MDL': ('MOLDOVA, REPUBLIC OF', 'Moldovan Leu', 2, '498'), 117 'MGA': ('MADAGASCAR', 'Malagasy Ariary', 2, '969'), 118 'MKD': ('MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OF', 'Denar', 2, '807'), 119 'MMK': ('MYANMAR', 'Kyat', 2, '104'), 120 'MNT': ('MONGOLIA', 'Tugrik', 2, '496'), 121 'MOP': ('MACAO', 'Pataca', 2, '446'), 122 'MRO': ('MAURITANIA', 'Ouguiya', 2, '478'), 123 'MUR': ('MAURITIUS', 'Mauritius Rupee', 2, '480'), 124 'MVR': ('MALDIVES', 'Rufiyaa', 2, '462'), 125 'MWK': ('MALAWI', 'Kwacha', 2, '454'), 126 'MXN': ('MEXICO', 'Mexican Peso', 2, '484'), 127 'MXV': ('MEXICO', 'Mexican Unidad de Inversion (UDI)', 2, '979'), 128 'MYR': ('MALAYSIA', 'Malaysian Ringgit', 2, '458'), 129 'MZN': ('MOZAMBIQUE', 'Mozambique Metical', 2, '943'), 130 'NAD': ('NAMIBIA', 'Namibia Dollar', 2, '516'), 131 'NGN': ('NIGERIA', 'Naira', 2, '566'), 132 'NIO': ('NICARAGUA', 'Cordoba Oro', 2, '558'), 133 'NOK': ('SVALBARD AND JAN MAYEN', 'Norwegian Krone', 2, '578'), 134 'NPR': ('NEPAL', 'Nepalese Rupee', 2, '524'), 135 'NZD': ('TOKELAU', 'New Zealand Dollar', 2, '554'), 136 'OMR': ('OMAN', 'Rial Omani', 3, '512'), 137 'PAB': ('PANAMA', 'Balboa', 2, '590'), 138 'PEN': ('PERU', 'Nuevo Sol', 2, '604'), 139 'PGK': ('PAPUA NEW GUINEA', 'Kina', 2, '598'), 140 'PHP': ('PHILIPPINES', 'Philippine Peso', 2, '608'), 141 'PKR': ('PAKISTAN', 'Pakistan Rupee', 2, '586'), 142 'PLN': ('POLAND', 'Zloty', 2, '985'), 143 'PYG': ('PARAGUAY', 'Guarani', 0, '600'), 144 'QAR': ('QATAR', 'Qatari Rial', 2, '634'), 145 'RON': ('ROMANIA', 'New Romanian Leu', 2, '946'), 146 'RSD': ('SERBIA', 'Serbian Dinar', 2, '941'), 147 'RUB': ('RUSSIAN FEDERATION', 'Russian Ruble', 2, '643'), 148 'RWF': ('RWANDA', 'Rwanda Franc', 0, '646'), 149 'SAR': ('SAUDI ARABIA', 'Saudi Riyal', 2, '682'), 150 'SBD': ('SOLOMON ISLANDS', 'Solomon Islands Dollar', 2, '090'), 151 'SCR': ('SEYCHELLES', 'Seychelles Rupee', 2, '690'), 152 'SDG': ('SUDAN', 'Sudanese Pound', 2, '938'), 153 'SEK': ('SWEDEN', 'Swedish Krona', 2, '752'), 154 'SGD': ('SINGAPORE', 'Singapore Dollar', 2, '702'), 113 'KRW': ('KOREA, REPUBLIC OF', _('Won'), 0, '410'), 114 'KWD': ('KUWAIT', _('Kuwaiti Dinar'), 3, '414'), 115 'KYD': ('CAYMAN ISLANDS', _('Cayman Islands Dollar'), 2, '136'), 116 'KZT': ('KAZAKHSTAN', _('Tenge'), 2, '398'), 117 'LAK': (u"LAO PEOPLE'S DEMOCRATIC REPUBLIC", _('Kip'), 2, '418'), 118 'LBP': ('LEBANON', _('Lebanese Pound'), 2, '422'), 119 'LKR': ('SRI LANKA', _('Sri Lanka Rupee'), 2, '144'), 120 'LRD': ('LIBERIA', _('Liberian Dollar'), 2, '430'), 121 'LSL': ('LESOTHO', _('Loti'), 2, '426'), 122 'LTL': ('LITHUANIA', _('Lithuanian Litas'), 2, '440'), 123 'LYD': ('LIBYA', _('Libyan Dinar'), 3, '434'), 124 'MAD': ('WESTERN SAHARA', _('Moroccan Dirham'), 2, '504'), 125 'MDL': ('MOLDOVA, REPUBLIC OF', _('Moldovan Leu'), 2, '498'), 126 'MGA': ('MADAGASCAR', _('Malagasy Ariary'), 2, '969'), 127 'MKD': ('MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OF', 128 _('Denar'), 129 2, 130 '807'), 131 'MMK': ('MYANMAR', _('Kyat'), 2, '104'), 132 'MNT': ('MONGOLIA', _('Tugrik'), 2, '496'), 133 'MOP': ('MACAO', _('Pataca'), 2, '446'), 134 'MRO': ('MAURITANIA', _('Ouguiya'), 2, '478'), 135 'MUR': ('MAURITIUS', _('Mauritius Rupee'), 2, '480'), 136 'MVR': ('MALDIVES', _('Rufiyaa'), 2, '462'), 137 'MWK': ('MALAWI', _('Kwacha'), 2, '454'), 138 'MXN': ('MEXICO', _('Mexican Peso'), 2, '484'), 139 'MXV': ('MEXICO', _('Mexican Unidad de Inversion (UDI)'), 2, '979'), 140 'MYR': ('MALAYSIA', _('Malaysian Ringgit'), 2, '458'), 141 'MZN': ('MOZAMBIQUE', _('Mozambique Metical'), 2, '943'), 142 'NAD': ('NAMIBIA', _('Namibia Dollar'), 2, '516'), 143 'NGN': ('NIGERIA', _('Naira'), 2, '566'), 144 'NIO': ('NICARAGUA', _('Cordoba Oro'), 2, '558'), 145 'NOK': ('SVALBARD AND JAN MAYEN', _('Norwegian Krone'), 2, '578'), 146 'NPR': ('NEPAL', _('Nepalese Rupee'), 2, '524'), 147 'NZD': ('TOKELAU', _('New Zealand Dollar'), 2, '554'), 148 'OMR': ('OMAN', _('Rial Omani'), 3, '512'), 149 'PAB': ('PANAMA', _('Balboa'), 2, '590'), 150 'PEN': ('PERU', _('Nuevo Sol'), 2, '604'), 151 'PGK': ('PAPUA NEW GUINEA', _('Kina'), 2, '598'), 152 'PHP': ('PHILIPPINES', _('Philippine Peso'), 2, '608'), 153 'PKR': ('PAKISTAN', _('Pakistan Rupee'), 2, '586'), 154 'PLN': ('POLAND', _('Zloty'), 2, '985'), 155 'PYG': ('PARAGUAY', _('Guarani'), 0, '600'), 156 'QAR': ('QATAR', _('Qatari Rial'), 2, '634'), 157 'RON': ('ROMANIA', _('New Romanian Leu'), 2, '946'), 158 'RSD': ('SERBIA', _('Serbian Dinar'), 2, '941'), 159 'RUB': ('RUSSIAN FEDERATION', _('Russian Ruble'), 2, '643'), 160 'RWF': ('RWANDA', _('Rwanda Franc'), 0, '646'), 161 'SAR': ('SAUDI ARABIA', _('Saudi Riyal'), 2, '682'), 162 'SBD': ('SOLOMON ISLANDS', _('Solomon Islands Dollar'), 2, '090'), 163 'SCR': ('SEYCHELLES', _('Seychelles Rupee'), 2, '690'), 164 'SDG': ('SUDAN', _('Sudanese Pound'), 2, '938'), 165 'SEK': ('SWEDEN', _('Swedish Krona'), 2, '752'), 166 'SGD': ('SINGAPORE', _('Singapore Dollar'), 2, '702'), 155 167 'SHP': ('SAINT HELENA, ASCENSION AND TRISTAN DA CUNHA', 156 'Saint Helena Pound',168 _('Saint Helena Pound'), 157 169 2, 158 170 '654'), 159 'SLL': ('SIERRA LEONE', 'Leone', 2, '694'),160 'SOS': ('SOMALIA', 'Somali Shilling', 2, '706'),161 'SRD': ('SURINAME', 'Surinam Dollar', 2, '968'),162 'SSP': ('SOUTH SUDAN', 'South Sudanese Pound', 2, '728'),163 'STD': ('SAO TOME AND PRINCIPE', 'Dobra', 2, '678'),164 'SVC': ('EL SALVADOR', 'El Salvador Colon', 2, '222'),165 'SYP': ('SYRIAN ARAB REPUBLIC', 'Syrian Pound', 2, '760'),166 'SZL': ('SWAZILAND', 'Lilangeni', 2, '748'),167 'THB': ('THAILAND', 'Baht', 2, '764'),168 'TJS': ('TAJIKISTAN', 'Somoni', 2, '972'),169 'TMT': ('TURKMENISTAN', 'Turkmenistan New Manat', 2, '934'),170 'TND': ('TUNISIA', 'Tunisian Dinar', 3, '788'),171 'TOP': ('TONGA', u"Pa'anga", 2, '776'),172 'TRY': ('TURKEY', 'Turkish Lira', 2, '949'),173 'TTD': ('TRINIDAD AND TOBAGO', 'Trinidad and Tobago Dollar', 2, '780'),174 'TWD': ('TAIWAN, PROVINCE OF CHINA', 'New Taiwan Dollar', 2, '901'),175 'TZS': ('TANZANIA, UNITED REPUBLIC OF', 'Tanzanian Shilling', 2, '834'),176 'UAH': ('UKRAINE', 'Hryvnia', 2, '980'),177 'UGX': ('UGANDA', 'Uganda Shilling', 0, '800'),178 'USD': ('VIRGIN ISLANDS (U.S.)', 'US Dollar', 2, '840'),179 'USN': ('UNITED STATES', 'US Dollar (Next day)', 2, '997'),171 'SLL': ('SIERRA LEONE', _('Leone'), 2, '694'), 172 'SOS': ('SOMALIA', _('Somali Shilling'), 2, '706'), 173 'SRD': ('SURINAME', _('Surinam Dollar'), 2, '968'), 174 'SSP': ('SOUTH SUDAN', _('South Sudanese Pound'), 2, '728'), 175 'STD': ('SAO TOME AND PRINCIPE', _('Dobra'), 2, '678'), 176 'SVC': ('EL SALVADOR', _('El Salvador Colon'), 2, '222'), 177 'SYP': ('SYRIAN ARAB REPUBLIC', _('Syrian Pound'), 2, '760'), 178 'SZL': ('SWAZILAND', _('Lilangeni'), 2, '748'), 179 'THB': ('THAILAND', _('Baht'), 2, '764'), 180 'TJS': ('TAJIKISTAN', _('Somoni'), 2, '972'), 181 'TMT': ('TURKMENISTAN', _('Turkmenistan New Manat'), 2, '934'), 182 'TND': ('TUNISIA', _('Tunisian Dinar'), 3, '788'), 183 'TOP': ('TONGA', _(u"Pa'anga"), 2, '776'), 184 'TRY': ('TURKEY', _('Turkish Lira'), 2, '949'), 185 'TTD': ('TRINIDAD AND TOBAGO', _('Trinidad and Tobago Dollar'), 2, '780'), 186 'TWD': ('TAIWAN, PROVINCE OF CHINA', _('New Taiwan Dollar'), 2, '901'), 187 'TZS': ('TANZANIA, UNITED REPUBLIC OF', _('Tanzanian Shilling'), 2, '834'), 188 'UAH': ('UKRAINE', _('Hryvnia'), 2, '980'), 189 'UGX': ('UGANDA', _('Uganda Shilling'), 0, '800'), 190 'USD': ('VIRGIN ISLANDS (U.S.)', _('US Dollar'), 2, '840'), 191 'USN': ('UNITED STATES', _('US Dollar (Next day)'), 2, '997'), 180 192 'UYI': ('URUGUAY', 181 'Uruguay Peso en Unidades Indexadas (URUIURUI)',193 _('Uruguay Peso en Unidades Indexadas (URUIURUI)'), 182 194 0, 183 195 '940'), 184 'UYU': ('URUGUAY', 'Peso Uruguayo', 2, '858'),185 'UZS': ('UZBEKISTAN', 'Uzbekistan Sum', 2, '860'),186 'VEF': ('VENEZUELA, BOLIVARIAN REPUBLIC OF', 'Bolivar', 2, '937'),187 'VND': ('VIET NAM', 'Dong', 0, '704'),188 'VUV': ('VANUATU', 'Vatu', 0, '548'),189 'WST': ('SAMOA', 'Tala', 2, '882'),190 'XAF': ('GABON', 'CFA Franc BEAC', 0, '950'),196 'UYU': ('URUGUAY', _('Peso Uruguayo'), 2, '858'), 197 'UZS': ('UZBEKISTAN', _('Uzbekistan Sum'), 2, '860'), 198 'VEF': ('VENEZUELA, BOLIVARIAN REPUBLIC OF', _('Bolivar'), 2, '937'), 199 'VND': ('VIET NAM', _('Dong'), 0, '704'), 200 'VUV': ('VANUATU', _('Vatu'), 0, '548'), 201 'WST': ('SAMOA', _('Tala'), 2, '882'), 202 'XAF': ('GABON', _('CFA Franc BEAC'), 0, '950'), 191 203 'XCD': ('SAINT VINCENT AND THE GRENADINES', 192 'East Caribbean Dollar',204 _('East Caribbean Dollar'), 193 205 2, 194 206 '951'), 195 'XOF': ('TOGO', 'CFA Franc BCEAO', 0, '952'),196 'XPF': ('WALLIS AND FUTUNA', 'CFP Franc', 0, '953'),197 'YER': ('YEMEN', 'Yemeni Rial', 2, '886'),198 'ZAR': ('SOUTH AFRICA', 'Rand', 2, '710'),199 'ZMW': ('ZAMBIA', 'Zambian Kwacha', 2, '967'),200 'ZWL': ('ZIMBABWE', 'Zimbabwe Dollar', 2, '932')207 'XOF': ('TOGO', _('CFA Franc BCEAO'), 0, '952'), 208 'XPF': ('WALLIS AND FUTUNA', _('CFP Franc'), 0, '953'), 209 'YER': ('YEMEN', _('Yemeni Rial'), 2, '886'), 210 'ZAR': ('SOUTH AFRICA', _('Rand'), 2, '710'), 211 'ZMW': ('ZAMBIA', _('Zambian Kwacha'), 2, '967'), 212 'ZWL': ('ZIMBABWE', _('Zimbabwe Dollar'), 2, '932') 201 213 } 202 214 … … 208 220 """ 209 221 return ISO_4217_CURRENCIES[currency_code][2] 222 223 224 #: A vocabulary of ISO 4217 currencies 225 ISO_4217_CURRENCIES_VOCAB = SimpleIkobaVocabulary( 226 *[(val[1], key) for key, val in ISO_4217_CURRENCIES.items()]) -
main/waeup.ikoba/branches/uli-payments/src/waeup/ikoba/payments/tests/test_currencies.py
r12248 r12294 1 1 import unittest 2 from zope.i18nmessageid.message import Message as i18nMessage 3 from zope.interface.verify import verifyObject 4 from zope.schema.interfaces import IVocabularyTokenized, ITerm 2 5 from waeup.ikoba.payments.currencies import ( 3 get_decimal_units, ISO_4217_CURRENCIES, 6 get_decimal_units, ISO_4217_CURRENCIES, ISO_4217_CURRENCIES_VOCAB, 4 7 ) 5 8 … … 10 13 # we can get the number of decimals for a currency code 11 14 assert get_decimal_units('USD') == 2 15 assert get_decimal_units('JPY') == 0 12 16 13 17 def test_iso_currencies_no_linebreak(self): … … 17 21 assert '\n' not in value[0] 18 22 assert '\n' not in value[1] 23 24 def test_iso_currencies_types(self): 25 # sanity check: make sure we have the correct types in all tuples 26 for key, value in ISO_4217_CURRENCIES.items(): 27 assert isinstance(value[1], i18nMessage) 28 assert isinstance(value[2], int) 29 assert isinstance(value[3], str) 30 31 def test_currencies_vocab_tokenized(self): 32 # we can get ISO currencies as a source suitable for forms etc. 33 verifyObject(IVocabularyTokenized, ISO_4217_CURRENCIES_VOCAB) 34 35 def test_currencies_vocab_i18nized(self): 36 # vocab titles are i18nized 37 result = ISO_4217_CURRENCIES_VOCAB.getTerm('USD') 38 assert ITerm.providedBy(result) 39 self.assertEqual(result.title, u'US Dollar') 40 assert isinstance(result.title, i18nMessage) 41 42 def test_currencies_vocab_tokens_are_string(self): 43 # vocab tokens are simple strings 44 result = ISO_4217_CURRENCIES_VOCAB.getTerm('USD') 45 assert ITerm.providedBy(result) 46 assert result.token == result.value 47 assert result.value == 'USD' 48 assert isinstance(result.token, str) 49 assert isinstance(result.value, str)
Note: See TracChangeset for help on using the changeset viewer.