renamed decorator needs_mongodb_x in test + fixes ref to mongo 2.4 from travis files

This commit is contained in:
Bastien Gérard
2018-10-02 22:03:55 +02:00
parent 55fc04752a
commit 9b6c972e0f
10 changed files with 31 additions and 38 deletions

View File

@@ -5,7 +5,7 @@ from mongoengine import *
from mongoengine.queryset import NULLIFY, PULL
from mongoengine.connection import get_db
from tests.utils import needs_mongodb_v26
from tests.utils import requires_mongodb_gte_26
__all__ = ("ClassMethodsTest", )
@@ -188,7 +188,7 @@ class ClassMethodsTest(unittest.TestCase):
self.assertEqual(BlogPostWithTags.compare_indexes(), { 'missing': [], 'extra': [] })
self.assertEqual(BlogPostWithCustomField.compare_indexes(), { 'missing': [], 'extra': [] })
@needs_mongodb_v26
@requires_mongodb_gte_26
def test_compare_indexes_for_text_indexes(self):
""" Ensure that compare_indexes behaves correctly for text indexes """

View File

@@ -8,7 +8,7 @@ import pymongo
from mongoengine import *
from mongoengine.connection import get_db
from tests.utils import get_mongodb_version, needs_mongodb_v26, MONGODB_32, MONGODB_3
from tests.utils import get_mongodb_version, requires_mongodb_gte_26, MONGODB_32, MONGODB_3
__all__ = ("IndexesTest", )
@@ -754,7 +754,7 @@ class IndexesTest(unittest.TestCase):
except NotUniqueError:
pass
def test_unique_and_primary(self):
def test_primary_save_duplicate_update_existing_object(self):
"""If you set a field as primary, then unexpected behaviour can occur.
You won't create a duplicate but you will update an existing document.
"""
@@ -872,7 +872,7 @@ class IndexesTest(unittest.TestCase):
info['provider_ids.foo_1_provider_ids.bar_1']['key'])
self.assertTrue(info['provider_ids.foo_1_provider_ids.bar_1']['sparse'])
@needs_mongodb_v26
@requires_mongodb_gte_26
def test_text_indexes(self):
class Book(Document):
title = DictField()

View File

@@ -25,7 +25,7 @@ from mongoengine.queryset import NULLIFY, Q
from mongoengine.context_managers import switch_db, query_counter
from mongoengine import signals
from tests.utils import needs_mongodb_v26
from tests.utils import requires_mongodb_gte_26
TEST_IMAGE_PATH = os.path.join(os.path.dirname(__file__),
'../fields/mongoengine.png')
@@ -840,7 +840,7 @@ class InstanceTest(MongoDBTestCase):
self.assertDbEqual([dict(other_doc.to_mongo()), dict(doc.to_mongo())])
@needs_mongodb_v26
@requires_mongodb_gte_26
def test_modify_with_positional_push(self):
class BlogPost(Document):
tags = ListField(StringField())
@@ -3272,7 +3272,7 @@ class InstanceTest(MongoDBTestCase):
person.update(set__height=2.0)
@needs_mongodb_v26
@requires_mongodb_gte_26
def test_push_with_position(self):
"""Ensure that push with position works properly for an instance."""
class BlogPost(Document):