Hammy Goonan
  • Home
  • About this blog
  • About Me
  • My Work
Subscribe
Tagged

unittest

A collection of 1 post

Flask

Testing File uploads in Flask

I was recently writing Flask integration tests for a form that had a file upload parameter. As it turns out, is isn't as straight forward as I had thought it would be. A basic file upload test might look like this: def test_logo(self): data = dict(logo=(io.BytesIO(

  • Hammy Goonan
Hammy Goonan Mar 4, 2016 • 1 min read
Hammy Goonan © 2022
Powered by Ghost