# SPDX-FileCopyrightText: 2019-present Tobias Kunze
# SPDX-License-Identifier: AGPL-3.0-only WITH LicenseRef-Pretalx-AGPL-3.0-Terms

from io import StringIO

import pytest
from django.core.management import call_command


@pytest.mark.django_db
def test_no_outstanding_migrations():
    out = StringIO()
    try:
        call_command("makemigrations", "--check", stdout=out, stderr=StringIO())
    except SystemExit:  # pragma: no cover
        raise AssertionError(f"Pending migrations:\n{out.getvalue()}") from None
