'Ensure that the correct "primary key" field name is used when
querying'

def test_query_pk_field_name(self):

    class BlogPost(Document, ):
        title = StringField(primary_key=True, db_field='postTitle')
    BlogPost.drop_collection()
    data = {'title': 'Post    1'}
    post = BlogPost(**data)
    post.save()
    self.assertTrue(('_id' in BlogPost.objects(pk=data['title'])._query))
    self.assertTrue(('_id' in BlogPost.objects(title=data['title'])._query))
    self.assertEqual(BlogPost.objects(pk=data['title']).count(), 1)
    BlogPost.drop_collection()
