def METHOD_NAME(self):
    def call_delete_unused_files_command():
        with captured_stdout() as stdout:
            call_command("delete_unused_files")
            return stdout.getvalue()
    def test_with_no_files():
        self.assertEqual(
            call_delete_unused_files_command().strip(), "No files deleted"
        )
    def test_with_files():
        filename = get_random_id()
        uploaded_file_path = self.temp_uploads_path.joinpath(filename)
        try:
            uploaded_file = TemporaryUploadedFile.objects.create(
                created=encode_datetime(2010, 1, 1),
                uploaded_file=ContentFile("", filename),
            )
            output = call_delete_unused_files_command()
            self.assertEqual(
                output.strip(),
                f"Deleted files: {Path(uploaded_file.uploaded_file.name).name}",
            )
            self.assertEqual(TemporaryUploadedFile.objects.count(), 0)
        finally:
            remove_p(uploaded_file_path)
    test_with_no_files()
    test_with_files()