Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: find() got an unexpected keyword argument 'slave_okay' #86

Closed
oliveagle opened this issue Mar 7, 2014 · 0 comments
Closed

Comments

@oliveagle
Copy link

use mongomock to mock mongoengine Document. it works great with this exception:

from mymodel import Post
from mongomock import Connection
Post._collection = Connection().db.collection
Post._get_db = lambda: Post._collection._Collection__database

post = Post(title='hahah')
post.save()
assert( Post._collection.count() == 1)

Post.objects.first()

the last line raises:

mongoengine/queryset/queryset.pyc in _cursor(self)
   1203 
   1204             self._cursor_obj = self._collection.find(self._query,
-> 1205                                                      **self._cursor_args)
   1206             # Apply where clauses to cursor
   1207             if self._where_clause:

TypeError: find() got an unexpected keyword argument 'slave_okay'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants