def test_date_to_datetime(self): """Ensure that :class:`date` is converted to :class:`datetime`""" got = _coerce_to_bson_compatible(date(2001, 9, 11)) expected = datetime(2001, 9, 11) eq_(got, expected, "Expected %r, got %r for date to datetime conversion" % (expected, got))
def test_decimal_to_float(self): """Ensure that :class:`Decimal` is converted to :class:`float`""" got = _coerce_to_bson_compatible(Decimal('1234.5678')) expected = 1234.5678 eq_(got, expected, "Expected %r, got %r for Decimal to float conversion" % (expected, got))