From bcbbbe40463eca15ad34f721430482bd8f16f9a3 Mon Sep 17 00:00:00 2001 From: Ross Lawley Date: Fri, 29 Nov 2013 12:04:30 +0000 Subject: [PATCH] Added test, updated AUTHORS and changelog (#498) --- AUTHORS | 3 ++- docs/changelog.rst | 1 + tests/queryset/queryset.py | 13 +++++++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/AUTHORS b/AUTHORS index a00acd15..f9be6765 100644 --- a/AUTHORS +++ b/AUTHORS @@ -183,4 +183,5 @@ that much better: * Joe Friedl (https://github.com/grampajoe) * Daniel Ward (https://github.com/danielward) * Aniket Deshpande (https://github.com/anicake) - * rfkrocktk (https://github.com/rfkrocktk) \ No newline at end of file + * rfkrocktk (https://github.com/rfkrocktk) + * Gustavo Andrés Angulo (https://github.com/woakas) diff --git a/docs/changelog.rst b/docs/changelog.rst index c21dc6b8..596b71b0 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -4,6 +4,7 @@ Changelog Changes in 0.8.5 ================ +- Fixed count and none bug (#498) - Fixed bug with .only() and DictField with digit keys (#496) - Added user_permissions to Django User object (#491, #492) - Fix updating Geo Location fields (#488) diff --git a/tests/queryset/queryset.py b/tests/queryset/queryset.py index de39ee10..7ff2965d 100644 --- a/tests/queryset/queryset.py +++ b/tests/queryset/queryset.py @@ -2882,6 +2882,19 @@ class QuerySetTest(unittest.TestCase): self.assertEqual(10, Post.objects.limit(5).skip(5).count(with_limit_and_skip=False)) + def test_count_and_none(self): + """Test count works with None()""" + + class MyDoc(Document): + pass + + MyDoc.drop_collection() + for i in xrange(0, 10): + MyDoc().save() + + self.assertEqual(MyDoc.objects.count(), 10) + self.assertEqual(MyDoc.objects.none().count(), 0) + def test_call_after_limits_set(self): """Ensure that re-filtering after slicing works """