Refactor and fix some issues with to_currency. Reduce code duplication. (#129)

* Refactor and fix some issues with to_currency. Reduce code duplication.

* Use unicode literals in uk testcase.
This commit is contained in:
Mārtiņš Šulcs
2017-11-01 02:17:13 +02:00
committed by Ernesto Rodriguez Ortiz
parent abae0b56a2
commit f9d8868794
10 changed files with 132 additions and 135 deletions

15
tests/test_lv.py Normal file
View File

@@ -0,0 +1,15 @@
# -*- encoding: utf-8 -*-
from __future__ import unicode_literals
from unittest import TestCase
from num2words import num2words
class Num2WordsLVTest(TestCase):
def test_to_currency(self):
self.assertEqual(
num2words('38.4', lang='lv', to='currency', seperator=' un',
cents=False, currency='EUR'),
"trīsdesmit astoņi eiro un 40 centi"
)