def test_clean_file_upload_form_invalid_json(self):
kwargs = {'next_view': 'Launch Stack'}
t = forms.TemplateForm({}, **kwargs)
precleaned = {
'template_data': 'http://templateurl.com',
}
json_str = '{notvalidjson::::::json/////json'
files = {'template_upload':
self.SimpleFile('template_name', json_str)}
self.assertRaises(
exceptions.ValidationError,
t.clean_uploaded_files,
'template',
'template',
precleaned,
files)
评论列表
文章目录