  # PyTest for running the tests.
  pytest==3.0.5
  pytest-django==3.1.2
  pytest-cov==2.4.0
  pytz==2016.10
 
</s> remove     field = serializers.DateTimeField(default_timezone=pytz.timezone('America/New_York'))
 </s> add     class MockTimezone:
        @staticmethod
        def localize(value, is_dst):
            raise compat.InvalidTimeError()

        def __str__(self):
            return 'America/New_York'

    field = serializers.DateTimeField(default_timezone=MockTimezone()) </s> remove from rest_framework import serializers
 </s> add from rest_framework import compat, serializers </s> remove from django.utils.timezone import pytz, utc
 </s> add from django.utils.timezone import utc </s> remove             except Exception:
 </s> add             except InvalidTimeError:
  # PyTest for running the tests.
  pytest==3.0.5
  pytest-django==3.1.2
  pytest-cov==2.4.0

keep keep keep keep replace
 Added pytz exception in compat module.
Mock pytz.timezone localize in tests.
Ref: #4986 
requirements/requirements-testing.txt