'Localization of numbers'

def test_locale_independent(self):

    settings.USE_L10N = True
    settings.USE_THOUSAND_SEPARATOR = False
    self.assertEqual(u'66666.66', nformat(self.n, decimal_sep='.', decimal_pos=2, grouping=3, thousand_sep=','))
    self.assertEqual(u'66666A6', nformat(self.n, decimal_sep='A', decimal_pos=1, grouping=1, thousand_sep='B'))
    settings.USE_THOUSAND_SEPARATOR = True
    self.assertEqual(u'66,666.66', nformat(self.n, decimal_sep='.', decimal_pos=2, grouping=3, thousand_sep=','))
    self.assertEqual(u'6B6B6B6B6A6', nformat(self.n, decimal_sep='A', decimal_pos=1, grouping=1, thousand_sep='B'))
    self.assertEqual(u'-66666.6', nformat((-66666.666), decimal_sep='.', decimal_pos=1))
    self.assertEqual(u'-66666.0', nformat(int('-66666'), decimal_sep='.', decimal_pos=1))
    self.assertEqual(u'10000.0', nformat(self.l, decimal_sep='.', decimal_pos=1))
    self.assertEqual(u'31.12.2009    \u0432    20:50', Template('{{    dt|date:"d.m.Y    \xd0\xb2    H:i"    }}').render(self.ctxt))
    self.assertEqual(u'\u231a    10:15', Template('{{    t|time:"\xe2\x8c\x9a    H:i"    }}').render(self.ctxt))
