0001-api-include-delays-in-agenda-API-29847.patch
chrono/api/views.py | ||
---|---|---|
93 | 93 |
'slug': agenda.slug, # kept for compatibility |
94 | 94 |
'text': agenda.label, |
95 | 95 |
'kind': agenda.kind, |
96 |
'minimal_booking_delay': agenda.minimal_booking_delay, |
|
97 |
'maximal_booking_delay': agenda.maximal_booking_delay, |
|
96 | 98 |
} |
97 | 99 | |
98 | 100 |
if agenda.kind == 'events': |
tests/test_api.py | ||
---|---|---|
100 | 100 |
resp = app.get('/api/agenda/') |
101 | 101 |
assert resp.json == {'data': [ |
102 | 102 |
{'text': 'Foo bar', 'id': u'foo-bar', 'slug': 'foo-bar', 'kind': 'events', |
103 |
'minimal_booking_delay': 1, 'maximal_booking_delay': 56, |
|
103 | 104 |
'api': {'datetimes_url': 'http://testserver/api/agenda/%s/datetimes/' % agenda1.slug, |
104 | 105 |
'fillslots_url': 'http://testserver/api/agenda/%s/fillslots/' % agenda1.slug}}, |
105 | 106 |
{'text': 'Foo bar Meeting', 'id': u'foo-bar-meeting', 'slug': 'foo-bar-meeting', |
107 |
'minimal_booking_delay': 1, 'maximal_booking_delay': 56, |
|
106 | 108 |
'kind': 'meetings', |
107 | 109 |
'api': {'meetings_url': 'http://testserver/api/agenda/%s/meetings/' % meetings_agenda.slug, |
108 | 110 |
'desks_url': 'http://testserver/api/agenda/%s/desks/' % meetings_agenda.slug, |
... | ... | |
110 | 112 |
}, |
111 | 113 |
}, |
112 | 114 |
{'text': 'Foo bar2', 'id': u'foo-bar2', 'kind': 'events', 'slug': 'foo-bar2', |
115 |
'minimal_booking_delay': 1, 'maximal_booking_delay': 56, |
|
113 | 116 |
'api': {'datetimes_url': 'http://testserver/api/agenda/%s/datetimes/' % agenda2.slug, |
114 | 117 |
'fillslots_url': 'http://testserver/api/agenda/%s/fillslots/' % agenda2.slug}} |
115 | 118 |
]} |
116 |
- |