fix the $max operator
This commit is contained in:
parent
a94ec06275
commit
7850e47bf7
@ -155,9 +155,7 @@ class GeoQueriesTest(MongoDBTestCase):
|
||||
"""Ensure that spherical geospatial queries are working
|
||||
"""
|
||||
# Needs MongoDB > 2.6.4 https://jira.mongodb.org/browse/SERVER-14039
|
||||
connection = get_connection()
|
||||
info = connection.test.command('buildInfo')
|
||||
mongodb_version = tuple([int(i) for i in info['version'].split('.')])
|
||||
mongodb_version = get_mongodb_version()
|
||||
if mongodb_version < (2, 6, 4):
|
||||
raise SkipTest("Need MongoDB version 2.6.4+")
|
||||
|
||||
@ -314,7 +312,7 @@ class GeoQueriesTest(MongoDBTestCase):
|
||||
self.assertEqual(events.count(), 0)
|
||||
|
||||
# $minDistance was only added in MongoDB v2.6, skip for older versions
|
||||
mongodb_ver = get_mongodb_ver()
|
||||
mongodb_ver = get_mongodb_version()
|
||||
if mongodb_ver[0] == 2 and mongodb_ver[1] < 6:
|
||||
raise SkipTest('Need MongoDB v2.6+')
|
||||
|
||||
|
@ -584,10 +584,10 @@ class QuerySetTest(unittest.TestCase):
|
||||
Scores.objects(id=scores.id).update(min__low_score=250)
|
||||
self.assertEqual(Scores.objects.get(id=scores.id).low_score, 150)
|
||||
|
||||
Scores.objects(id=scores.id).update(max__high_score=250)
|
||||
self.assertEqual(Scores.objects.get(id=scores.id).low_score, 250)
|
||||
Scores.objects(id=scores.id).update(max__high_score=100)
|
||||
self.assertEqual(Scores.objects.get(id=scores.id).low_score, 250)
|
||||
Scores.objects(id=scores.id).update(max__high_score=1000)
|
||||
self.assertEqual(Scores.objects.get(id=scores.id).low_score, 1000)
|
||||
Scores.objects(id=scores.id).update(max__high_score=500)
|
||||
self.assertEqual(Scores.objects.get(id=scores.id).low_score, 1000)
|
||||
|
||||
def test_updates_can_have_match_operators(self):
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user