test for RecommenderXBlock

I have to check the content_type of the uploaded file to make sure the user doesn't upload some strange files.
```python
request.POST['file'].file.content_type in ['image/png', 'image/gif', 'image/jpeg', 'image/pjpeg']
```
I am not sure is there any a good way to set the content_type of io.StringIO