title: Testing Image upload with Django and Webtest
body: <p>Does anyone know how I can test the image upload with using WebTest. My current code is:</p>
  
  <pre><code>form['avatar'] =('avatar', os.path.join(settings.PROJECT_PATH, 'static', 'img', 'avatar.png'))
  res = form.submit()
  </code></pre>
  
  <p>In the response I get the following error "Upload a valid image. The file you uploaded was either not an image or a corrupted image.".</p>
  
  <p>Any help will be appreciated.</p>