chrono/tests
Benjamin Dauvergne ece063b2b3 api: optimize get_all_slots() and around it (#42169)
Workflow in get_all_slots() is simplified :
* first we accumulate, for each desk, the set of time slots when a booking cannot
occur or is already booked,
* then we generate the list of possible time slots and match them to the
exclusion and already booked set.

Intervals is replaced by a simpler data-structure, IntervalSet, it does
not need to be a map, a simple set is enough.

Also :
* moved TimePeriod.get_effective_timeperiods() to the agenda level , it
deduplictes TimePeriod between desks and remove excluded TimePeriod for
virtual agendas.

* added a named-tuple WeekTime to represent a TimePeriod base unit, so
we can use them in IntervalSet easily (as they can be compared) to
compute the effective time periods,

* the fact that base_duration is unique for a given virtual agenda is
now accounted and stated everywhere,

* the fact that generated time slots must have time in the local
timezone for the API to work is now stated everywhere,

* In get_all_slots(), also :
  * integrated the code of get_exceptions_by_desk() into get_all_slots()
  to further reduce the number of SQL queries.
  * used_min/max_datetime is reduced by the exclusion periods, and
    effective time periods are grouped based on the used_min/max_datetime of
    each agenda.
  * pre-filter slots for uniqueness when generating available datetimes
    (but for filling slot we still need exact availability information
    for each desk)
2020-05-19 18:19:34 +02:00
..
data test rruleset emptyness (#27263) 2018-10-22 12:08:35 +02:00
conftest.py tests: use a temporary MEDIA_ROOT (#42325) 2020-04-30 12:56:17 +02:00
metz.json add test on metz data (#42169) 2020-05-19 14:54:55 +02:00
settings.py jenkins: run tests using postgres (#39583) 2020-03-13 10:20:43 +01:00
test_agendas.py api: optimize get_all_slots() and around it (#42169) 2020-05-19 18:19:34 +02:00
test_api.py api: optimize get_all_slots() and around it (#42169) 2020-05-19 18:19:34 +02:00
test_api_utils.py general: reformat using black (#37464) 2019-12-16 16:24:38 +01:00
test_import_export.py agendas: fix import when unknown field found (#42523) 2020-05-07 11:25:44 +02:00
test_interval.py api: optimize get_all_slots() and around it (#42169) 2020-05-19 18:19:34 +02:00
test_manager.py manager: view to duplicate a desk (#42626) 2020-05-18 10:21:59 +02:00
test_metz.py api: optimize get_all_slots() and around it (#42169) 2020-05-19 18:19:34 +02:00
test_misc.py general: reformat using black (#37464) 2019-12-16 16:24:38 +01:00
test_sso.py general: reformat using black (#37464) 2019-12-16 16:24:38 +01:00
test_time_periods.py api: optimize get_all_slots() and around it (#42169) 2020-05-19 18:19:34 +02:00