'Cookie accepts an aware datetime as expiration time'

def test_aware_expiration(self):

    response = HttpResponse()
    expires = (datetime.utcnow() + timedelta(seconds=10)).replace(tzinfo=utc)
    time.sleep(0.001)
    response.set_cookie('datetime', expires=expires)
    datetime_cookie = response.cookies['datetime']
    self.assertEqual(datetime_cookie['max-age'], 10)
