def test_valid_data(self): publication_document = ModelFactory.make('PublicationDocument') document = publication_document.document form = PublicationDocumentForm( {}, {'document': SimpleUploadedFile(document.name, document.read())}) self.assertTrue(form.is_valid())
def test_blank_data(self): form = PublicationDocumentForm({}) self.assertFalse(form.is_valid())
def test_valid_data(self): publication_document = ModelFactory.make('PublicationDocument') document = publication_document.document form = PublicationDocumentForm({}, {'document': SimpleUploadedFile(document.name, document.read())}) self.assertTrue(form.is_valid())