refactor more field tests into submodules #1983

This commit is contained in:
Bastien Gérard
2019-02-21 23:12:19 +01:00
parent 28606e9985
commit b9cc8a4ca9
15 changed files with 1722 additions and 1619 deletions

View File

@@ -13,7 +13,7 @@ MONGO_TEST_DB = 'mongoenginetest' # standard name for the test database
# Constant that can be used to compare the version retrieved with
# get_mongodb_version()
MONGODB_26 = (2, 6)
MONGODB_3 = (3,0)
MONGODB_3 = (3, 0)
MONGODB_32 = (3, 2)
@@ -33,6 +33,11 @@ class MongoDBTestCase(unittest.TestCase):
cls._connection.drop_database(MONGO_TEST_DB)
def get_as_pymongo(doc):
"""Fetch the pymongo version of a certain Document"""
return doc.__class__.objects.as_pymongo().get(id=doc.id)
def get_mongodb_version():
"""Return the version of the connected mongoDB (first 2 digits)