          self.assertEqual(local_now.tzinfo, local_tz)
  
      def test_localtime_out_of_range(self):
          local_tz = timezone.LocalTimezone()
          long_ago = datetime.datetime(1900, 1, 1, tzinfo=timezone.utc)
          try:
              timezone.localtime(long_ago, local_tz)
          except (OverflowError, ValueError) as exc:
 
</s> remove 

@override_settings(TIME_ZONE='Africa/Nairobi')
class UtilitiesTests(TestCase):

    def test_make_aware(self):
        self.assertEqual(
            timezone.make_aware(datetime.datetime(2011, 9, 1, 13, 20, 30), EAT),
            datetime.datetime(2011, 9, 1, 13, 20, 30, tzinfo=EAT)
        )
        self.assertEqual(
            timezone.make_aware(datetime.datetime(2011, 9, 1, 10, 20, 30), UTC),
            datetime.datetime(2011, 9, 1, 10, 20, 30, tzinfo=UTC)
        )

    def test_make_naive(self):
        self.assertEqual(
            timezone.make_naive(datetime.datetime(2011, 9, 1, 13, 20, 30, tzinfo=EAT), EAT),
            datetime.datetime(2011, 9, 1, 13, 20, 30)
        )
        self.assertEqual(
            timezone.make_naive(datetime.datetime(2011, 9, 1, 13, 20, 30, tzinfo=EAT), UTC),
            datetime.datetime(2011, 9, 1, 10, 20, 30)
        )
        self.assertEqual(
            timezone.make_naive(datetime.datetime(2011, 9, 1, 10, 20, 30, tzinfo=UTC), UTC),
            datetime.datetime(2011, 9, 1, 10, 20, 30)
        )
 </s> add  </s> remove         # available for pytz time zones
 </s> add         # This method is available for pytz time zones. </s> remove     if is_naive(value):
        raise ValueError("make_naive expects an aware value, got %s" % value)
 </s> add     # If `value` is naive, astimezone() will raise a ValueError,
    # so we don't need to perform a redundant check.
    def test_localtime_naive(self):
        with self.assertRaises(ValueError):
            timezone.localtime(datetime.datetime.now())

          self.assertEqual(local_now.tzinfo, local_tz)
  
    def test_localtime_naive(self):
        with self.assertRaises(ValueError):
            timezone.localtime(datetime.datetime.now())

      def test_localtime_out_of_range(self):
          local_tz = timezone.LocalTimezone()
          long_ago = datetime.datetime(1900, 1, 1, tzinfo=timezone.utc)
          try:
              timezone.localtime(long_ago, local_tz)
          except (OverflowError, ValueError) as exc:
keep add keep keep keep keep keep keep
 Optimized make_aware/naive by removing redundant checks. Refs #22625.

Also added tests with pytz and removed misplaced tests. 
tests/utils_tests/test_timezone.py