def test_empty_file(self):
        with open(self.temp_name, 'w') as f:
            f.write('')
        with open(self.temp_name, 'rb') as f:
            data = {'upload': f}
            response = self.client.post(self.url, data)
        self.assertEqual(response.status_code, 200)
        result = json.loads(response.content.decode('utf-8'))
        self.assertEqual(result, {'is_valid': False, 'errors': {'upload': ['The submitted file is empty.']}})
Uploading an empty file is not valid.
dataset/ETHPy150Open caktus/django-sticky-uploads/stickyuploads/tests/test_views.py/UploadViewTestCase.test_empty_file