I'm simply using Django's SimpleUploadedFile
to test
from django.core.files.uploadedfile import SimpleUploadedFile
file = SimpleUploadedFile("invoice.pdf", bytes.fromhex("25504446") + b"test1234")
self.client.post(url, data={"invoice_file": file})
The Hex determines, that the created file is a PDF (as stated here https://stackoverflow.com/a/6187004/14698152)
My API directly uses the UploadedFile so i don't know if it works with the Schema you provided
from ninja import UploadedFile
def my_endpoint(self, invoice_file: UploadedFile = File(None)):
...dosomething()...