mirror of
https://github.com/inventree/InvenTree.git
synced 2025-05-01 13:06:45 +00:00
make test simpler
This commit is contained in:
parent
09bda7e516
commit
9f3fdcb590
@ -64,16 +64,9 @@ class InvenTreeTaskTests(TestCase):
|
|||||||
"""Test the task delete_successful_tasks"""
|
"""Test the task delete_successful_tasks"""
|
||||||
from django_q.models import Success
|
from django_q.models import Success
|
||||||
|
|
||||||
Success.objects.create(
|
Success.objects.create(name='abc', func='abc', stopped=threshold, started=threshold_low)
|
||||||
name='abc',
|
|
||||||
func='abc',
|
|
||||||
started=timezone.now() - timedelta(days=31)
|
|
||||||
)
|
|
||||||
InvenTree.tasks.offload_task(InvenTree.tasks.delete_successful_tasks)
|
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))
|
self.assertEqual(len(results, 0))
|
||||||
|
|
||||||
def test_task_delete_old_error_logs(self):
|
def test_task_delete_old_error_logs(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user