                      return value.astimezone(field_timezone)
                  except OverflowError:
                      self.fail('overflow')
              try:
                  return timezone.make_aware(value, field_timezone)
              except InvalidTimeError:
                  self.fail('make_aware', timezone=field_timezone)
          elif (field_timezone is None) and timezone.is_aware(value):
              return timezone.make_naive(value, datetime.timezone.utc)
          return value
 
</s> remove     def test_valid_inputs(self):
 </s> add     def test_valid_inputs(self, *args): </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         cls.kolkata = pytz.timezone('Asia/Kolkata')
 </s> add         cls.kolkata = ZoneInfo('Asia/Kolkata') </s> remove @pytest.mark.skipif(pytz is None, reason='pytz not installed')
 </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
                      return value.astimezone(field_timezone)
                  except OverflowError:
                      self.fail('overflow')
              try:
                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
              except InvalidTimeError:
                  self.fail('make_aware', timezone=field_timezone)
          elif (field_timezone is None) and timezone.is_aware(value):
              return timezone.make_naive(value, datetime.timezone.utc)
          return value
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> 
rest_framework/fields.py