@pytest.mark.django_db
def test_make_naive_explicit_tz(settings):
 settings.USE_TZ = True
 datetime_object = timezone.make_aware(datetime(2016, 1, 2, 21, 52, 25), timezone=pytz.timezone('Europe/Helsinki'))
 assert timezone.is_aware(datetime_object)
 naive_datetime = make_naive(datetime_object, tz=pytz.timezone('Asia/Bangkok'))
 assert timezone.is_naive(naive_datetime)
 assert (naive_datetime.hour == ((datetime_object.hour + 5) % 24))

@ pytest . mark . django_db def test_make_naive_explicit_tz ( settings ) : settings . USE_TZ = True datetime_object = timezone . make_aware ( datetime ( 2016 , 1 , 2 , 21 , 52 , 25 ) , timezone = pytz . timezone ( 'Europe/Helsinki' ) ) assert timezone . is_aware ( datetime_object ) naive_datetime = make_naive ( datetime_object , tz = pytz . timezone ( 'Asia/Bangkok' ) ) assert timezone . is_naive ( naive_datetime ) assert ( naive_datetime . hour == ( ( datetime_object . hour + 5 ) % 24 ) )
tests datetimes are made naive of the given timezone .