@@ -156,7 +156,7 @@ class AllDatatypesModel(Model):
156156 e = columns .DateTime ()
157157 f = columns .Decimal ()
158158 g = columns .Double ()
159- h = columns .Float (double_precision = False )
159+ h = columns .Float ()
160160 i = columns .Inet ()
161161 j = columns .Integer ()
162162 k = columns .Text ()
@@ -225,13 +225,8 @@ def test_can_insert_double_and_float(self):
225225 """
226226 Test for inserting single-precision and double-precision values into a Float and Double columns
227227
228- test_can_insert_double_and_float tests a Float can only hold a single-precision value, unless
229- "double_precision" attribute is specified as True or is unspecified. This test first tests that an AttributeError
230- is raised when attempting to input a double-precision value into a single-precision Float. It then verifies that
231- Double, Float(double_precision=True) and Float() can hold double-precision values by default. It also verifies that
232- columns.Float(double_precision=False) can hold a single-precision value, and a Double can hold a single-precision value.
233-
234228 @since 2.6.0
229+ @changed 3.0.0 removed deprecated Float(double_precision) parameter
235230 @jira_ticket PYTHON-246
236231 @expected_result Each floating point column type is able to hold their respective precision values.
237232
@@ -240,24 +235,19 @@ def test_can_insert_double_and_float(self):
240235
241236 class FloatingPointModel (Model ):
242237 id = columns .Integer (primary_key = True )
243- a = columns .Float (double_precision = False )
244- b = columns .Float (double_precision = True )
245- c = columns .Float ()
238+ f = columns .Float ()
246239 d = columns .Double ()
247240
248241 sync_table (FloatingPointModel )
249242
250- FloatingPointModel .create (id = 0 , a = 2.39 )
243+ FloatingPointModel .create (id = 0 , f = 2.39 )
251244 output = FloatingPointModel .objects ().first ()
252- self .assertEqual (2.390000104904175 , output .a )
245+ self .assertEqual (2.390000104904175 , output .f ) # float loses precision
253246
254- FloatingPointModel .create (id = 0 , a = 3.4028234663852886e+38 , b = 2.39 , c = 2.39 , d = 2.39 )
247+ FloatingPointModel .create (id = 0 , f = 3.4028234663852886e+38 , d = 2.39 )
255248 output = FloatingPointModel .objects ().first ()
256-
257- self .assertEqual (3.4028234663852886e+38 , output .a )
258- self .assertEqual (2.39 , output .b )
259- self .assertEqual (2.39 , output .c )
260- self .assertEqual (2.39 , output .d )
249+ self .assertEqual (3.4028234663852886e+38 , output .f )
250+ self .assertEqual (2.39 , output .d ) # double retains precision
261251
262252 FloatingPointModel .create (id = 0 , d = 3.4028234663852886e+38 )
263253 output = FloatingPointModel .objects ().first ()
0 commit comments