forked from MongoEngine/mongoengine
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Getting tests passing #7
Open
lastcraft
wants to merge
19
commits into
colinhowe:master
Choose a base branch
from
conversocial:getting_tests_passing
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fix: noticket - dont dereference related on reload
In pymongo3, no need to use hosts_or_uri.
aa7cd5b broke the following test: ====================================================================== FAIL: test_ordering (tests.queryset.QuerySetTest) Ensure default ordering is applied and can be overridden. ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/vagrant/conv_libs/mongoengine/tests/queryset.py", line 755, in test_ordering self.assertEqual(latest_post.title, "Blog Post #3") AssertionError: u'Blog Post #1' != 'Blog Post #3' This is because we were no longer calling sort() on the cursor after calling order_by.
6cc87c2 introduced a breaking change causing the following test to fail: FAIL: test_clone (tests.queryset.QuerySetTest) Ensure that cloning clones complex querysets ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/vagrant/conv_libs/mongoengine/tests/queryset.py", line 2496, in test_clone self.assertEqual(test.count(), test2.count()) AssertionError: 89 != 10 However, it was not the .clone() call that was failing. The cursor that had *not* been cloned was not having the limit() call applied because the pymongo cursor had already been created. The above commit introduced a similar error for skip() and hint() calls. The test introduced to test skip() breaks without the change in place, however, I could not find a test for hint() but I have re-introduced the previous behaviour.
3d4b752 introduced a bug that caused the following test to fail: FAIL: test_pagination (tests.django_tests.QuerySetTest) Ensure that Pagination works as expected ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/vagrant/conv_libs/mongoengine/tests/django_tests.py", line 92, in test_pagination self.assertEqual(t.render(Context(d)), u'%d:%d:' % (start, end)) AssertionError: u'3:4:5:6:' != u'3:4:' Only in some very rare cases (that the Django Paginator exercised) was paging/slicing broken. I couldn't get a reproducable test case that showed the same behaviour outside of the Django Paginator :(
Fix Broken MongoEngine Tests (All commits reference the breaking change)
when comparing to different classes. Why? Short reason: We have the concept of MongoRef (a light wrapper that holds a pointer to a MongoEngine document). When performing basic equality checks we would like a MongoRef and Document of the same type/id to be considered equal. This update causes MongoEngine to return NotImplemented instead of False when comparing against things that are not the same class. Which will allow us to implement/allow the comparison in our MongoRef class. https://docs.python.org/2/reference/datamodel.html NotImplemented This type has a single value. There is a single object with this value. This object is accessed through the built-in name NotImplemented. Numeric methods and rich comparison methods may return this value if they do not implement the operation for the operands provided. (The interpreter will then try the reflected operation, or some other fallback, depending on the operator.) Its truth value is true.
feat: noticket - Update Document __eq__/__ne__ to return NotImplemented
feat: noticket - add batch_size support to QuerySet
6617050
to
0d4f501
Compare
iainb
pushed a commit
to iainb/mongoengine
that referenced
this pull request
Nov 30, 2018
fix: CON-112 - Get tests passing
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.