Removed pool_size from connect, minor tidyup
This commit is contained in:
parent
df5b1f3806
commit
89f505bb13
6 changed files with 16 additions and 10 deletions
|
|
@ -106,7 +106,7 @@ class FieldTest(unittest.TestCase):
|
|||
person.height = 1.89
|
||||
person.validate()
|
||||
|
||||
person.height = 2
|
||||
person.height = '2.0'
|
||||
self.assertRaises(ValidationError, person.validate)
|
||||
person.height = 0.01
|
||||
self.assertRaises(ValidationError, person.validate)
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ class QuerySetTest(unittest.TestCase):
|
|||
"""Ensure that a QuerySet is correctly initialised by QuerySetManager.
|
||||
"""
|
||||
self.assertTrue(isinstance(self.Person.objects, QuerySet))
|
||||
self.assertEqual(self.Person.objects._collection.name(),
|
||||
self.assertEqual(self.Person.objects._collection.name,
|
||||
self.Person._meta['collection'])
|
||||
self.assertTrue(isinstance(self.Person.objects._collection,
|
||||
pymongo.collection.Collection))
|
||||
|
|
@ -294,6 +294,8 @@ class QuerySetTest(unittest.TestCase):
|
|||
BlogPost.drop_collection()
|
||||
|
||||
def test_q(self):
|
||||
"""Ensure that Q objects may be used to query for documents.
|
||||
"""
|
||||
class BlogPost(Document):
|
||||
publish_date = DateTimeField()
|
||||
published = BooleanField()
|
||||
|
|
@ -618,6 +620,8 @@ class QuerySetTest(unittest.TestCase):
|
|||
class QTest(unittest.TestCase):
|
||||
|
||||
def test_or_and(self):
|
||||
"""Ensure that Q objects may be combined correctly.
|
||||
"""
|
||||
q1 = Q(name='test')
|
||||
q2 = Q(age__gte=18)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue