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