def dates(self, field_name, kind, order='ASC'):
        assert kind in ("year", "month", "day"), \
            "'kind' must be one of 'year', 'month' or 'day'."
        assert order in ('ASC', 'DESC'), \
            "'order' must be either 'ASC' or 'DESC'."
        return self.annotate(
            datefield=Date(field_name, kind),
            plain_field=F(field_name)
        ).values_list(
            'datefield', flat=True
        ).distinct().filter(plain_field__isnull=False).order_by(('-' if order == 'DESC' else '') + 'datefield')
Test sending unsubscription request.
dataset/ETHPy150Open django/django/django/db/models/query.py/QuerySet.dates--crossover with--dataset/ETHPy150Open ralphm/wokkel/wokkel/test/test_pubsub.py/PubSubClientTest.test_unsubscribe