def test_upload_file(self):
        t = make_tempfile()
        with open(t, 'rb') as file_obj:
            data = {
                'file': file_obj,
            }
            with Settings(settings, DEBUG=False,
                          TRANSFER_SERVER=self.transfer_server):
                r = self.getClient().post('/upload/', data)
        r = json.loads(r.content.decode())
        self.assertEqual(os.getpid(), int(r['files']['file']['data']))
Upload test case with real file.
dataset/ETHPy150Open smartfile/django-transfer/django_transfer/tests.py/UploadTestCase.test_upload_file