Beispiel #1
0
    def test_valid_archive_image_form(self):
        upload_file = (settings.BASE_DIR / "fixtures" / "archive-gallery.zip").open("rb")

        data = {}
        files = {"file": SimpleUploadedFile(upload_file.name, upload_file.read())}
        form = ArchiveImageForm(data, files)

        self.assertTrue(form.is_valid())
        upload_file.close()
Beispiel #2
0
    def test_valid_archive_image_form(self):
        upload_file = open(os.path.join(settings.BASE_DIR, 'fixtures', 'archive-gallery.zip'), 'rb')

        data = {}
        files = {
            'file': SimpleUploadedFile(upload_file.name, upload_file.read())
        }
        form = ArchiveImageForm(data, files)

        self.assertTrue(form.is_valid())
        upload_file.close()