mirror of
https://github.com/WeblateOrg/weblate.git
synced 2026-07-26 14:23:58 +08:00
These were introduced before add-ons existed, but now they overlap with site-wide installed add-ons while not having the same visibility. Fixes #19307
35 lines
1,018 B
Python
Vendored
35 lines
1,018 B
Python
Vendored
# Copyright © Michal Čihař <michal@weblate.org>
|
|
#
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
"""Assertion for cleanup settings migration."""
|
|
|
|
from weblate.addons.events import AddonEvent
|
|
from weblate.addons.models import Addon, Event
|
|
|
|
comments = Addon.objects.get(
|
|
component__isnull=True,
|
|
category__isnull=True,
|
|
project__isnull=True,
|
|
name="weblate.removal.comments",
|
|
)
|
|
assert comments.configuration == {"age": 15}
|
|
assert Event.objects.filter(addon=comments, event=AddonEvent.EVENT_DAILY).exists()
|
|
assert (
|
|
Addon.objects.filter(
|
|
component__isnull=True,
|
|
category__isnull=True,
|
|
project__isnull=True,
|
|
name="weblate.removal.comments",
|
|
).count()
|
|
== 1
|
|
)
|
|
|
|
suggestions = Addon.objects.get(
|
|
component__isnull=True,
|
|
category__isnull=True,
|
|
project__isnull=True,
|
|
name="weblate.removal.suggestions",
|
|
)
|
|
assert suggestions.configuration == {"age": 20, "votes": None}
|
|
assert Event.objects.filter(addon=suggestions, event=AddonEvent.EVENT_DAILY).exists()
|