api: subscription listing, date_end is excluded (#61573)
This commit is contained in:
parent
75bc19b333
commit
c5b542b359
|
@ -1949,7 +1949,7 @@ agendas_events_fillslots = MultipleAgendasEventsFillslots.as_view()
|
|||
|
||||
class SubscriptionFilter(filters.FilterSet):
|
||||
date_start = filters.DateFilter(lookup_expr='gte')
|
||||
date_end = filters.DateFilter(lookup_expr='lte')
|
||||
date_end = filters.DateFilter(lookup_expr='lt')
|
||||
|
||||
class Meta:
|
||||
model = Subscription
|
||||
|
|
|
@ -92,7 +92,7 @@ def test_api_list_subscription_filter_date_start(app, user):
|
|||
|
||||
app.authorization = ('Basic', ('john.doe', 'password'))
|
||||
|
||||
resp = app.get('/api/agenda/%s/subscription/' % agenda.slug, params={'date_start': '2021-08-31'})
|
||||
resp = app.get('/api/agenda/%s/subscription/' % agenda.slug, params={'date_start': '2021-09-01'})
|
||||
assert [d['id'] for d in resp.json['data']] == [subscription1.pk, subscription2.pk]
|
||||
resp = app.get('/api/agenda/%s/subscription/' % agenda.slug, params={'date_start': '2021-09-02'})
|
||||
assert [d['id'] for d in resp.json['data']] == [subscription2.pk]
|
||||
|
@ -126,7 +126,7 @@ def test_api_list_subscription_filter_date_end(app, user):
|
|||
assert [d['id'] for d in resp.json['data']] == [subscription1.pk, subscription2.pk]
|
||||
resp = app.get('/api/agenda/%s/subscription/' % agenda.slug, params={'date_end': '2021-10-02'})
|
||||
assert [d['id'] for d in resp.json['data']] == [subscription1.pk]
|
||||
resp = app.get('/api/agenda/%s/subscription/' % agenda.slug, params={'date_end': '2021-09-30'})
|
||||
resp = app.get('/api/agenda/%s/subscription/' % agenda.slug, params={'date_end': '2021-10-01'})
|
||||
assert [d['id'] for d in resp.json['data']] == []
|
||||
|
||||
resp = app.get(
|
||||
|
|
Loading…
Reference in New Issue