mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-28 11:36:44 +00:00
feat(backend): test custom command (#9479)
This commit is contained in:
parent
2eb0331ddd
commit
2987cdfbb2
@ -108,3 +108,5 @@ class Command(spectacular.Command):
|
|||||||
settings.SPECTACULAR_SETTINGS['APPEND_COMPONENTS'] = components
|
settings.SPECTACULAR_SETTINGS['APPEND_COMPONENTS'] = components
|
||||||
|
|
||||||
super().handle(*args, **kwargs)
|
super().handle(*args, **kwargs)
|
||||||
|
|
||||||
|
return 'done'
|
||||||
|
13
src/backend/InvenTree/InvenTree/test_commands.py
Normal file
13
src/backend/InvenTree/InvenTree/test_commands.py
Normal 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')
|
Loading…
x
Reference in New Issue
Block a user