Skip to content

Commit bcbbbe4

Browse files
committed
Added test, updated AUTHORS and changelog (#498)
1 parent 7200a8c commit bcbbbe4

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

AUTHORS

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,4 +183,5 @@ that much better:
183183
* Joe Friedl (https://github.com/grampajoe)
184184
* Daniel Ward (https://github.com/danielward)
185185
* Aniket Deshpande (https://github.com/anicake)
186-
* rfkrocktk (https://github.com/rfkrocktk)
186+
* rfkrocktk (https://github.com/rfkrocktk)
187+
* Gustavo Andrés Angulo (https://github.com/woakas)

docs/changelog.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Changelog
44

55
Changes in 0.8.5
66
================
7+
- Fixed count and none bug (#498)
78
- Fixed bug with .only() and DictField with digit keys (#496)
89
- Added user_permissions to Django User object (#491, #492)
910
- Fix updating Geo Location fields (#488)

tests/queryset/queryset.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2882,6 +2882,19 @@ class Post(Document):
28822882

28832883
self.assertEqual(10, Post.objects.limit(5).skip(5).count(with_limit_and_skip=False))
28842884

2885+
def test_count_and_none(self):
2886+
"""Test count works with None()"""
2887+
2888+
class MyDoc(Document):
2889+
pass
2890+
2891+
MyDoc.drop_collection()
2892+
for i in xrange(0, 10):
2893+
MyDoc().save()
2894+
2895+
self.assertEqual(MyDoc.objects.count(), 10)
2896+
self.assertEqual(MyDoc.objects.none().count(), 0)
2897+
28852898
def test_call_after_limits_set(self):
28862899
"""Ensure that re-filtering after slicing works
28872900
"""

0 commit comments

Comments
 (0)