Хочу написать тест для проверки таска в celery, и казалось бы просто проверяю функции, но не получается так как пустой queryset.
В shell - Content.objects.all() = 
<QuerySet [<Content: Content object (3)>, <Content: Content object (4)>]>
В tests.py - Content.objects.all() = 
`<QuerySet []>`
tests.py:
   
class TaskTest(TestCase):
        def test_scale_image(self):
            path = Content.objects.get(id=4).image.path
            output_size = update_image(path,500, 500)
            self.assertEqual(output_size, (500,500))
models.py:
   
class Content(models.Model):
    
    width = models.IntegerField()
    heigth = models.IntegerField()
    image = models.ImageField(blank=True)
    
    def save(self, *args, **kwargs):
        super().save(*args, **kwargs)
        try:
            update_image.delay(self.image.path, self.width, self.heigth)
        except Exception as e:
            logger.error('Ошибка в таске: {}'.format(e))
tasks.py:
   
@shared_task
    def update_image(path, width, heigth):
        image = Image.open(path)
        output_size = (width, heigth)
        image.thumbnail(output_size)
        image.save(path)
        return output_size