mirror of
https://github.com/WeblateOrg/weblate.git
synced 2026-07-27 22:09:03 +08:00
Add workspaces as a top-level containers above projects and migrate billing to it. This does not add any new functionality just introduces the model and migrates billing to it. Issue #19535
20 lines
727 B
Python
Vendored
20 lines
727 B
Python
Vendored
# Copyright © Michal Čihař <michal@weblate.org>
|
|
#
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
"""Assertion for billing workspace migration."""
|
|
|
|
from weblate.billing.models import Billing
|
|
from weblate.trans.models import Project
|
|
|
|
project = Project.objects.get(slug="workspace-migration")
|
|
billing = Billing.objects.get(plan__name="Workspace migration plan")
|
|
|
|
assert project.workspace_id is not None, "Project workspace was not migrated"
|
|
assert billing.workspace_id == project.workspace_id, (
|
|
f"Billing workspace {billing.workspace_id} does not match "
|
|
f"project workspace {project.workspace_id}"
|
|
)
|
|
assert project.workspace.name == "Workspace Migration", (
|
|
f"Unexpected workspace name: {project.workspace.name}"
|
|
)
|