mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-11-04 07:05:41 +00:00 
			
		
		
		
	add tests for InvenTree.tasks
This commit is contained in:
		@@ -41,3 +41,22 @@ class ScheduledTaskTests(TestCase):
 | 
				
			|||||||
        # But the 'minutes' should have been updated
 | 
					        # But the 'minutes' should have been updated
 | 
				
			||||||
        t = Schedule.objects.get(func=task)
 | 
					        t = Schedule.objects.get(func=task)
 | 
				
			||||||
        self.assertEqual(t.minutes, 5)
 | 
					        self.assertEqual(t.minutes, 5)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class InvenTreeTaskTests(TestCase):
 | 
				
			||||||
 | 
					    """Unit tests for tasks"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def test_task_hearbeat(self, name):
 | 
				
			||||||
 | 
					        """Test the task heartbeat"""
 | 
				
			||||||
 | 
					        InvenTree.tasks.offload_task(InvenTree.tasks.heartbeat)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def test_task_delete_successful_tasks(self, name):
 | 
				
			||||||
 | 
					        """Test the task delete_successful_tasks"""
 | 
				
			||||||
 | 
					        InvenTree.tasks.offload_task(InvenTree.tasks.delete_successful_tasks)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def test_task_delete_old_error_logs(self, name):
 | 
				
			||||||
 | 
					        """Test the task delete_old_error_logs"""
 | 
				
			||||||
 | 
					        InvenTree.tasks.offload_task(InvenTree.tasks.delete_old_error_logs)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def test_task_check_for_updates(self, name):
 | 
				
			||||||
 | 
					        """Test the task check_for_updates"""
 | 
				
			||||||
 | 
					        InvenTree.tasks.offload_task(InvenTree.tasks.check_for_updates)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user