Пример #1
0
    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))
Пример #2
0
    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))
Пример #3
0
    def test_accepts_normal_files(self):
        file = NamedBlobFile('bla bla', filename=u'test.txt')

        validator = UploadValidator(*self.validator_arguments())

        validator.validate(file)
Пример #4
0
    def test_accepts_normal_files(self):
        file = NamedBlobFile("bla bla", filename=u"test.txt")

        validator = UploadValidator(*self.validator_arguments())

        validator.validate(file)