summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/raw_query/tests.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/raw_query/tests.py b/tests/raw_query/tests.py
index 1f0d0c363f..703a6b311e 100644
--- a/tests/raw_query/tests.py
+++ b/tests/raw_query/tests.py
@@ -330,3 +330,11 @@ class RawQueryTests(TestCase):
books = Book.objects.raw('SELECT * FROM raw_query_book')
list(books.iterator())
list(books.iterator())
+
+ def test_bool(self):
+ self.assertIs(bool(Book.objects.raw('SELECT * FROM raw_query_book')), True)
+ self.assertIs(bool(Book.objects.raw('SELECT * FROM raw_query_book WHERE id = 0')), False)
+
+ def test_len(self):
+ self.assertEqual(len(Book.objects.raw('SELECT * FROM raw_query_book')), 4)
+ self.assertEqual(len(Book.objects.raw('SELECT * FROM raw_query_book WHERE id = 0')), 0)