extend update check

This commit is contained in:
Matthias 2022-05-16 23:41:33 +02:00
parent 2ec59a6ad2
commit f3c4720f5b
No known key found for this signature in database
GPG Key ID: AB6D0E6C4CB65093

View File

@ -9,6 +9,7 @@ from django.test import TestCase
from django_q.models import Schedule
import InvenTree.tasks
from common.models import InvenTreeSetting
class ScheduledTaskTests(TestCase):
@ -75,4 +76,13 @@ class InvenTreeTaskTests(TestCase):
def test_task_check_for_updates(self):
"""Test the task check_for_updates"""
# Check that setting should be empty
self.assertEqual(InvenTreeSetting.get_setting('INVENTREE_LATEST_VERSION'), '')
# Get new version
InvenTree.tasks.offload_task(InvenTree.tasks.check_for_updates)
# Check that setting is not empty
response = InvenTreeSetting.get_setting('INVENTREE_LATEST_VERSION')
self.assertNotEqual(response, '')
self.assertTrue(bool(response))