refactored deprecated pymongo methods in tests
- remove/count/add_user/insert - added pymongo_support
This commit is contained in:
		| @@ -3,16 +3,14 @@ import unittest | ||||
|  | ||||
| from bson import SON | ||||
| from mongoengine import * | ||||
| from mongoengine.connection import get_db | ||||
|  | ||||
| __all__ = ("DeltaTest",) | ||||
| from mongoengine.pymongo_support import list_collection_names | ||||
| from tests.utils import MongoDBTestCase | ||||
|  | ||||
|  | ||||
| class DeltaTest(unittest.TestCase): | ||||
| class DeltaTest(MongoDBTestCase): | ||||
|  | ||||
|     def setUp(self): | ||||
|         connect(db='mongoenginetest') | ||||
|         self.db = get_db() | ||||
|         super(DeltaTest, self).setUp() | ||||
|  | ||||
|         class Person(Document): | ||||
|             name = StringField() | ||||
| @@ -25,9 +23,7 @@ class DeltaTest(unittest.TestCase): | ||||
|         self.Person = Person | ||||
|  | ||||
|     def tearDown(self): | ||||
|         for collection in self.db.collection_names(): | ||||
|             if 'system.' in collection: | ||||
|                 continue | ||||
|         for collection in list_collection_names(self.db): | ||||
|             self.db.drop_collection(collection) | ||||
|  | ||||
|     def test_delta(self): | ||||
|   | ||||
		Reference in New Issue
	
	Block a user