From 9f3fdcb59074d81235e5fb7f086743f7cc5d7f78 Mon Sep 17 00:00:00 2001 From: Matthias Date: Mon, 16 May 2022 23:43:07 +0200 Subject: [PATCH] make test simpler --- InvenTree/InvenTree/test_tasks.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/InvenTree/InvenTree/test_tasks.py b/InvenTree/InvenTree/test_tasks.py index 9952eccff4..bbcf7a4799 100644 --- a/InvenTree/InvenTree/test_tasks.py +++ b/InvenTree/InvenTree/test_tasks.py @@ -64,16 +64,9 @@ class InvenTreeTaskTests(TestCase): """Test the task delete_successful_tasks""" from django_q.models import Success - Success.objects.create( - name='abc', - func='abc', - started=timezone.now() - timedelta(days=31) - ) + Success.objects.create(name='abc', func='abc', stopped=threshold, started=threshold_low) InvenTree.tasks.offload_task(InvenTree.tasks.delete_successful_tasks) - threshold = timezone.now() - timedelta(days=30) - results = Success.objects.filter( - started__lte=threshold - ) + results = Success.objects.filter(started__lte=threshold) self.assertEqual(len(results, 0)) def test_task_delete_old_error_logs(self):