def test_does_not_accept_emails(self): mail = NamedBlobFile('bla bla', filename=u'test.eml') validator = UploadValidator(*self.validator_arguments()) with self.assertRaises(Invalid) as cm: self.assertFalse(validator.validate(mail)) self.assertEquals('error_mail_upload', str(cm.exception))
def test_does_not_accept_emails(self): mail = NamedBlobFile("bla bla", filename=u"test.eml") validator = UploadValidator(*self.validator_arguments()) with self.assertRaises(Invalid) as cm: self.assertFalse(validator.validate(mail)) self.assertEquals("error_mail_upload", str(cm.exception))
def test_accepts_normal_files(self): file = NamedBlobFile('bla bla', filename=u'test.txt') validator = UploadValidator(*self.validator_arguments()) validator.validate(file)
def test_accepts_normal_files(self): file = NamedBlobFile("bla bla", filename=u"test.txt") validator = UploadValidator(*self.validator_arguments()) validator.validate(file)