@@ -61,6 +61,7 @@ def test_datetime_tzinfo_io(self):
6161 class TZ (tzinfo ):
6262 def utcoffset (self , date_time ):
6363 return timedelta (hours = - 1 )
64+
6465 def dst (self , date_time ):
6566 return None
6667
@@ -91,7 +92,7 @@ def test_datetime_none(self):
9192 self .assertIsNone (dts [0 ][0 ])
9293
9394 def test_datetime_invalid (self ):
94- dt_value = 'INVALID'
95+ dt_value = 'INVALID'
9596 with self .assertRaises (TypeError ):
9697 self .DatetimeTest .objects .create (test_id = 4 , created_at = dt_value )
9798
@@ -125,7 +126,7 @@ def test_datetime_truncate_microseconds(self):
125126 dt_truncated = datetime (2024 , 12 , 31 , 10 , 10 , 10 , 923000 )
126127 self .DatetimeTest .objects .create (test_id = 6 , created_at = dt_value )
127128 dt2 = self .DatetimeTest .objects (test_id = 6 ).first ()
128- self .assertEqual (dt2 .created_at ,dt_truncated )
129+ self .assertEqual (dt2 .created_at , dt_truncated )
129130 finally :
130131 # We need to always return behavior to default
131132 DateTime .truncate_microseconds = False
@@ -191,7 +192,7 @@ def test_varint_io(self):
191192 self .VarIntTest .objects .create (test_id = 0 , bignum = "not_a_number" )
192193
193194
194- class DataType () :
195+ class DataType :
195196 @classmethod
196197 def setUpClass (cls ):
197198 if PROTOCOL_VERSION < 4 or CASSANDRA_VERSION < Version ("3.0" ):
@@ -344,6 +345,7 @@ def setUpClass(cls):
344345 )
345346 super (TestBoolean , cls ).setUpClass ()
346347
348+
347349@greaterthanorequalcass3_11
348350class TestDuration (DataType , BaseCassEngTestCase ):
349351 @classmethod
@@ -507,7 +509,7 @@ def test_timeuuid_io(self):
507509class TestInteger (BaseCassEngTestCase ):
508510 class IntegerTest (Model ):
509511
510- test_id = UUID (primary_key = True , default = lambda :uuid4 ())
512+ test_id = UUID (primary_key = True , default = lambda : uuid4 ())
511513 value = Integer (default = 0 , required = True )
512514
513515 def test_default_zero_fields_validate (self ):
@@ -519,8 +521,8 @@ def test_default_zero_fields_validate(self):
519521class TestBigInt (BaseCassEngTestCase ):
520522 class BigIntTest (Model ):
521523
522- test_id = UUID (primary_key = True , default = lambda :uuid4 ())
523- value = BigInt (default = 0 , required = True )
524+ test_id = UUID (primary_key = True , default = lambda : uuid4 ())
525+ value = BigInt (default = 0 , required = True )
524526
525527 def test_default_zero_fields_validate (self ):
526528 """ Tests that bigint columns with a default value of 0 validate """
@@ -612,10 +614,6 @@ def test_type_checking(self):
612614 with self .assertRaises (ValidationError ):
613615 Ascii ().validate ('Beyonc' + chr (233 ))
614616
615- if sys .version_info < (3 , 1 ):
616- with self .assertRaises (ValidationError ):
617- Ascii ().validate (u'Beyonc' + unichr (233 ))
618-
619617 def test_unaltering_validation (self ):
620618 """ Test the validation step doesn't re-interpret values. """
621619 self .assertEqual (Ascii ().validate ('' ), '' )
@@ -736,8 +734,6 @@ def test_type_checking(self):
736734
737735 Text ().validate ("!#$%&\' ()*+,-./" )
738736 Text ().validate ('Beyonc' + chr (233 ))
739- if sys .version_info < (3 , 1 ):
740- Text ().validate (u'Beyonc' + unichr (233 ))
741737
742738 def test_unaltering_validation (self ):
743739 """ Test the validation step doesn't re-interpret values. """
@@ -810,7 +806,7 @@ def test_conversion_specific_date(self):
810806 from uuid import UUID
811807 assert isinstance (uuid , UUID )
812808
813- ts = (uuid .time - 0x01b21dd213814000 ) / 1e7 # back to a timestamp
809+ ts = (uuid .time - 0x01b21dd213814000 ) / 1e7 # back to a timestamp
814810 new_dt = datetime .fromtimestamp (ts , tz = timezone .utc ).replace (tzinfo = None )
815811
816812 # checks that we created a UUID1 with the proper timestamp
0 commit comments