forked from WeblateOrg/weblate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_commands.py
29 lines (21 loc) · 858 Bytes
/
test_commands.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Copyright © Michal Čihař <michal@weblate.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
from io import StringIO
from django.core.management import call_command
from django.test import SimpleTestCase, TestCase
from weblate.trans.tests.utils import TempDirMixin
class CommandTests(SimpleTestCase, TempDirMixin):
def test_cleanup(self):
output = StringIO()
call_command("cleanup_celery", stderr=output)
self.assertIn(" it will be removed in Weblate", output.getvalue())
def test_queues(self):
output = StringIO()
call_command("celery_queues", stdout=output)
self.assertIn("celery:", output.getvalue())
class DBCommandTests(TestCase):
def test_stats(self):
output = StringIO()
call_command("ensure_stats", stdout=output)
self.assertEqual("", output.getvalue())