'Ensure that binary fields can be stored and retrieved.'

def test_binary_fields(self):

    class Attachment(Document, ):
        content_type = StringField()
        blob = BinaryField()
    BLOB = six.b('\xe6\x00\xc4\xff\x07')
    MIME_TYPE = 'application/octet-stream'
    Attachment.drop_collection()
    attachment = Attachment(content_type=MIME_TYPE, blob=BLOB)
    attachment.save()
    attachment_1 = Attachment.objects().first()
    self.assertEqual(MIME_TYPE, attachment_1.content_type)
    self.assertEqual(BLOB, six.binary_type(attachment_1.blob))
