(self)
| 1041 | self.assertRaises(ValueError, single_form.submit, "button") |
| 1042 | |
| 1043 | def test_upload_invalid_content(self): |
| 1044 | app = webtest.TestApp(SingleUploadFileApp()) |
| 1045 | res = app.get('/') |
| 1046 | single_form = res.forms["file_upload_form"] |
| 1047 | single_form.set("file-field", ('my_file.dat', 1)) |
| 1048 | try: |
| 1049 | single_form.submit("button") |
| 1050 | except ValueError: |
| 1051 | e = sys.exc_info()[1] |
| 1052 | self.assertEqual( |
| 1053 | str(e), |
| 1054 | u('File content must be %s not %s' % (bytes, int)) |
| 1055 | ) |
| 1056 | |
| 1057 | def test_invalid_uploadfiles(self): |
| 1058 | app = webtest.TestApp(SingleUploadFileApp()) |
nothing calls this directly
no test coverage detected