          cls.date_format = '%d/%m/%Y %H:%M'
  
      def test_should_render_date_time_in_default_timezone(self):
          field = serializers.DateTimeField(default_timezone=self.kolkata, format=self.date_format)
          dt = datetime.datetime(2018, 2, 8, 14, 15, 16, tzinfo=pytz.utc)
  
          with override(self.kolkata):
              rendered_date = field.to_representation(dt)
  
          rendered_date_in_timezone = dt.astimezone(self.kolkata).strftime(self.date_format)
 
</s> remove         cls.kolkata = pytz.timezone('Asia/Kolkata')
 </s> add         cls.kolkata = ZoneInfo('Asia/Kolkata') </s> remove class TestNaiveDayLightSavingTimeTimeZoneDateTimeField(FieldValues):
 </s> add @pytest.mark.skipif(pytz is None, reason="As Django 4.0 has deprecated pytz, this test should eventually be able to get removed.")
class TestPytzNaiveDayLightSavingTimeTimeZoneDateTimeField(FieldValues): </s> remove                 return timezone.make_aware(value, field_timezone)
 </s> add                 dt = timezone.make_aware(value, field_timezone)
                # When the resulting datetime is a ZoneInfo instance, it won't necessarily
                # throw given an invalid datetime, so we need to specifically check.
                if not valid_datetime(dt):
                    self.fail('make_aware', timezone=field_timezone)
                return dt </s> remove     def test_invalid_inputs(self):
 </s> add     def test_invalid_inputs(self, *args): </s> remove         cls.kolkata = pytz.timezone('Asia/Kolkata')
 </s> add         cls.kolkata = ZoneInfo('Asia/Kolkata')
        dt = datetime.datetime(2018, 2, 8, 14, 15, 16, tzinfo=ZoneInfo("UTC"))
          cls.date_format = '%d/%m/%Y %H:%M'
  
      def test_should_render_date_time_in_default_timezone(self):
          field = serializers.DateTimeField(default_timezone=self.kolkata, format=self.date_format)
        dt = datetime.datetime(2018, 2, 8, 14, 15, 16, tzinfo=ZoneInfo("UTC"))
  
          with override(self.kolkata):
              rendered_date = field.to_representation(dt)
  
          rendered_date_in_timezone = dt.astimezone(self.kolkata).strftime(self.date_format)
keep keep keep keep replace keep keep keep keep keep
 Use ZoneInfo as primary source of timezone data (#8924)

* Use ZoneInfo as primary source of timezone data

* Update tests/test_fields.py

---------

Co-authored-by: Asif Saif Uddin <auvipy@gmail.com> 
tests/test_fields.py