示例#1
0
 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())
示例#2
0
 def test_blank_data(self):
     form = PublicationDocumentForm({})
     self.assertFalse(form.is_valid())
示例#3
0
 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())
示例#4
0
 def test_blank_data(self):
     form = PublicationDocumentForm({})
     self.assertFalse(form.is_valid())