import unittest
from app.models import currency_format
from app.views import currency_integer


class MyTestCase(unittest.TestCase):
    def test_currency_format(self):
        self.assertEqual("123.456.789,01€", currency_format(12345678901), "First not equal")
        self.assertEqual("0,12€", currency_format(12), "Second not equal")
        self.assertEqual("123,00€", currency_format(12300), "Third not equal")

    def test_currency_integer(self):
        self.assertEqual(12345678901, currency_integer("123.456.789,01€"), "First not equal")
        self.assertEqual(12, currency_integer("0,12€"), "Second not equal")
        self.assertEqual(12300, currency_integer("123,00€"), "Third not equal")
        self.assertEqual(18948900, currency_integer("189489"), "Fourth not equal")

if __name__ == '__main__':
    unittest.main()
