'Ensure you can use `pk` as part of a query'

def test_index_with_pk(self):

    class Comment(EmbeddedDocument, ):
        comment_id = IntField(required=True)
    try:
        class BlogPost(Document, ):
            comments = EmbeddedDocumentField(Comment)
            meta = {'indexes': [{'fields': ['pk', 'comments.comment_id'], 'unique': True}]}
    except UnboundLocalError:
        self.fail('Unbound    local    error    at    index    +    pk    definition')
    info = BlogPost.objects._collection.index_information()
    info = [value['key'] for (key, value) in info.iteritems()]
    index_item = [('_id', 1), ('comments.comment_id', 1)]
    self.assertTrue((index_item in info))
