mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-11-16 22:01:28 +01:00
Describe the API token authentication, name the colliding transaction type enums, and use nullable instead of an OpenAPI 3.1 null type. A test keeps the schema free of warnings.
12 lines
453 B
Python
12 lines
453 B
Python
import tempfile
|
|
|
|
from django.core.management import call_command
|
|
from django.test import SimpleTestCase
|
|
|
|
|
|
class SchemaTests(SimpleTestCase):
|
|
def test_schema_is_valid_without_warnings(self):
|
|
"""Keeps /api/docs/ complete: drf-spectacular warns when it can't describe something."""
|
|
with tempfile.NamedTemporaryFile(suffix=".yml") as schema:
|
|
call_command("spectacular", "--validate", "--fail-on-warn", "--file", schema.name)
|