2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-27 19:16:44 +00:00

feat(backend): test custom command (#9479)

This commit is contained in:
Matthias Mair 2025-04-08 23:37:28 +02:00 committed by GitHub
parent 2eb0331ddd
commit 2987cdfbb2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 0 deletions

View File

@ -108,3 +108,5 @@ class Command(spectacular.Command):
settings.SPECTACULAR_SETTINGS['APPEND_COMPONENTS'] = components
super().handle(*args, **kwargs)
return 'done'

View File

@ -0,0 +1,13 @@
"""Testts for custom InvenTree management commands."""
from django.core.management import call_command
from django.test import TestCase
class CommandTestCase(TestCase):
"""Test case for custom management commands."""
def test_schema(self):
"""Test the schema generation command."""
output = call_command('schema', verbosity=0)
self.assertEqual(output, 'done')