'Ensure you can add meta data to file'

def test_file_saving(self):

    class Animal(Document, ):
        genus = StringField()
        family = StringField()
        photo = FileField()
    Animal.drop_collection()
    marmot = Animal(genus='Marmota', family='Sciuridae')
    marmot_photo = open(TEST_IMAGE_PATH, 'rb')
    marmot.photo.put(marmot_photo, content_type='image/jpeg', foo='bar')
    marmot.photo.close()
    marmot.save()
    marmot = Animal.objects.get()
    self.assertEqual(marmot.photo.content_type, 'image/jpeg')
    self.assertEqual(marmot.photo.foo, 'bar')
