oncall-engine/engine/common/tests
Vadim Stepanov 602ed535e3
Fix duplicate orders on routes and escalation policies (#2568)
# What this PR does

Fix duplicate `order` values for models `EscalationPolicy` and
`ChannelFilter` using the same approach as
https://github.com/grafana/oncall/pull/2278.

- Make internal API action `move_to_position` a part of
[OrderedModelViewSet](https://github.com/grafana/oncall/pull/2568/files#diff-eb62521ccbcb072d1bd2156adeadae3b5895bce6d0d54432a23db3948b0ada54R11-R34),
so all ordered model views use the same logic.
- Make public API serializers for ordered models inherit from
[OrderedModelSerializer](https://github.com/grafana/oncall/pull/2568/files#diff-d749f94af5a49adaf5074325cdfad10ddd5a52dbfd78b49582867ebb9c92fae5R6-R38),
so ordered model views are consistent with each other in public API.
- Remove `order` from plugin fronted, since it's not being used
anywhere. The frontend uses step indices & `move_to_position` action
instead.
- Make escalation snapshot use step indices instead of orders, since
orders are not guaranteed to be sequential (+fix a minor off-by-one bug)

## Which issue(s) this PR fixes

https://github.com/grafana/oncall-private/issues/1680

## Checklist

- [x] Unit, integration, and e2e (if applicable) tests updated
- [x] Documentation added (or `pr:no public docs` PR label added if not
required)
- [x] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not
required)
2023-07-18 17:17:53 +00:00
..
__init__.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
test_apply_jinja_template.py Added preview and migration API endpoints for route migration from regex into jinja2 (#1715) 2023-04-18 02:53:53 +00:00
test_create_engine_url.py Use utility function to create URLs 2022-07-12 15:42:20 -06:00
test_database.py Add utility function to get readonly db key if defined (#1264) 2023-02-01 12:07:32 +01:00
test_l10n.py add user locale field to mobile app user settings table + change going on call push notification text (#2131) 2023-06-14 12:19:58 -04:00
test_markup.py Fix cuddled list Markdown issue (#2488) 2023-07-11 09:14:52 +00:00
test_ordered_model.py Fix duplicate orders on routes and escalation policies (#2568) 2023-07-18 17:17:53 +00:00
test_recaptcha.py Add validation of hostname for recapctha (#1445) 2023-03-06 08:59:48 +00:00
test_regex_replace.py linting and fixed test 2022-07-14 20:06:24 +10:00
test_timezones.py centralize timezone validation + add serializer validation for on call shifts and schedules (#924) 2022-12-01 14:13:39 +01:00
test_urlize.py Fix warnings when running backend tests (#2079) 2023-06-06 18:38:00 +00:00
test_urlvalidator_without_tld.py use CustomURLValidator in custom_button (#1398) 2023-03-23 12:21:17 +00:00
test_viewset_actions.py Make viewset actions more consistent (#2120) 2023-06-07 12:10:53 +00:00