def testGetConverters(self): converters = converter.get_converters((Decimal,)) # Curreny is a subclass of Decimal, so it should be in converters conv = converter.get_converter(currency) self.assertTrue(conv in converters) converters = converter.get_converters((object,)) # Object is treated specially. Make sure its in the list conv = converter.get_converter(object) self.assertTrue(conv in converters)
def testGetConverters(self): converters = converter.get_converters((decimal.Decimal, )) # Curreny is a subclass of Decimal, so it should be in converters conv = converter.get_converter(currency) self.assertTrue(conv in converters) converters = converter.get_converters((object, )) # Object is treated specially. Make sure its in the list conv = converter.get_converter(object) self.assertTrue(conv in converters)
def _get_converters(self): if not self.widget_type: AssertionError("%r should define a widget_type" % self) allowed = self.widget_type.allowed_data_types return converter.get_converters(allowed)