feat: support rejected application status

This commit is contained in:
nyan404 committed 2026-08-25 15:15:48 +03:00
1 parent 08ec58c7e9
commit cd33a382c0
5 files changed
+47 -15

No files matched your search

+13
View File
@@ -93,6 +93,19 @@ class ApplicationTests(unittest.TestCase):
self.assertEqual(exporter.sync_pending(), 0)
self.assertEqual(len(store.pending_exports()), 2)
def test_rejected_application_is_retained_without_acceptance_side_effects(self) -> None:
with tempfile.TemporaryDirectory() as directory:
store = ApplicationStore(sqlite_path=Path(directory) / "applications.sqlite3")
application_id = store.create(application=validate_application({
"type": "feather_donation", "name": "Белка", "character_id": 58775,
"feathers": [{"amount": 1, "color": "красное", "source": "личные запасы"}],
}), actor_id=10, reply_peer_id=10, source="vk")
rejected = store.review(application_id, status="rejected")
self.assertEqual(rejected["status"], "rejected")
self.assertEqual(store.list(status="rejected")[0]["id"], application_id)
self.assertEqual(store.pending_notifications(), [])
self.assertEqual([event["event_type"] for event in store.pending_exports()], ["application_created"])
def test_google_export_refuses_an_insecure_endpoint_even_when_enabled(self) -> None:
with tempfile.TemporaryDirectory() as directory:
store = ApplicationStore(sqlite_path=Path(directory) / "applications.sqlite3")