def afterSetUp(self):
     """
     """
     super(TestCurrencyManagementUSD, self).afterSetUp()
     self.shop.setCurrency("usd")
     
     self.cm = ICurrencyManagement(self.shop)
class TestCurrencyManagementUSD(EasyShopTestCase):
    """
    """
    def afterSetUp(self):
        """
        """
        super(TestCurrencyManagementUSD, self).afterSetUp()
        self.shop.setCurrency("usd")
        
        self.cm = ICurrencyManagement(self.shop)
        
    def testGetLongName(self):
        """
        """
        self.assertEqual(self.cm.getLongName(), "US-Dollar")
        
    def testGetShortName(self):
        """
        """
        self.assertEqual(self.cm.getShortName(), "USD")
        
    def testGetSymbol(self):
        """
        """
        self.assertEqual(self.cm.getSymbol(), "$")
                
    def testPriceToString(self):
        """
        """
        price = 42.0
        
        string = self.cm.priceToString(price)
        self.assertEqual(string, "$ 42,00")
        
        string = self.cm.priceToString(price, "short")
        self.assertEqual(string, "USD 42,00")
        
        string = self.cm.priceToString(price, "long")
        self.assertEqual(string, "US-Dollar 42,00")

        string = self.cm.priceToString(price, "long", "after")
        self.assertEqual(string, "42,00 US-Dollar")
class TestCurrencyManagementEUR(EasyShopTestCase):
    """
    """
    def afterSetUp(self):
        """
        """
        super(TestCurrencyManagementEUR, self).afterSetUp()
        self.cm = ICurrencyManagement(self.shop)
        
    def testGetLongName(self):
        """
        """
        self.assertEqual(self.cm.getLongName(), "Euro")
        
    def testGetShortName(self):
        """
        """
        self.assertEqual(self.cm.getShortName(), "EUR")
        
    def testGetSymbol(self):
        """
        """
        self.assertEqual(self.cm.getSymbol(), "€")
                
    def testPriceToString(self):
        """
        """
        price = 42.0
        
        string = self.cm.priceToString(price)
        self.assertEqual(string, "€ 42,00")
        
        string = self.cm.priceToString(price, "short")
        self.assertEqual(string, "EUR 42,00")
        
        string = self.cm.priceToString(price, "long")
        self.assertEqual(string, "Euro 42,00")

        string = self.cm.priceToString(price, "long", "after")
        self.assertEqual(string, "42,00 Euro")
 def afterSetUp(self):
     """
     """
     super(TestCurrencyManagementEUR, self).afterSetUp()
     self.cm = ICurrencyManagement(self.shop)