I'm relatively new to Pyramid, so I'm struggling with writing tests for my
picture upload form.
How can I add picture to the dummy request?
Here is the function I would like to test.
if 'form.submitted' in request.params:
log.info("recieved picture upload request")
form = Form(request, schema=PictureUpload)
if request.method == 'POST' and form.validate():
#TODO replace hardcoded value with value from config
upload_directory = 'PATH'
upload = request.POST.get('profile')
image_type = imghdr.what(upload.filename, upload.value)
saved_file = str(upload_directory) + str(upload.filename)
perm_file = open(saved_file, 'wb')
redirect_url = route_url('profile', request)