diff --git a/tests/test_aggregate.py b/tests/test_aggregate.py index 25cc002..7079967 100644 --- a/tests/test_aggregate.py +++ b/tests/test_aggregate.py @@ -50,8 +50,8 @@ def test_Aggregate(self): res = yield self.coll.aggregate([{"$match": {"oh": "hai"}}], full_response=True) - self.assertIn("ok", res) - self.assertIn("result", res) + self.assertTrue("ok" in res) + self.assertTrue("result" in res) self.assertEqual(len(res["result"]), 2) @defer.inlineCallbacks diff --git a/tests/test_collection.py b/tests/test_collection.py index 522e354..1de504d 100644 --- a/tests/test_collection.py +++ b/tests/test_collection.py @@ -86,7 +86,7 @@ def make_col(base, name): self.assertEqual(self.db.test.test, self.db.test("test")) options = yield self.db.test.options() - self.assertIsInstance(options, dict) + self.assertTrue(isinstance(options, dict)) yield self.db.drop_collection("test") collection_names = yield self.db.collection_names() diff --git a/tests/test_queries.py b/tests/test_queries.py index a3180c1..b5ea730 100644 --- a/tests/test_queries.py +++ b/tests/test_queries.py @@ -18,7 +18,6 @@ from twisted.trial import unittest import txmongo from txmongo.protocol import MongoClientProtocol -from collections import OrderedDict mongo_host = "localhost" mongo_port = 27017 @@ -211,10 +210,12 @@ def test_AsClass(self): yield self.coll.insert({'x': 42}) doc = yield self.coll.find_one({}) - self.assertIs(type(doc), dict) + self.assertTrue(type(doc) is dict) - doc = yield self.coll.find_one({}, as_class=OrderedDict) - self.assertIs(type(doc), OrderedDict) + class CustomDict(dict): pass + + doc = yield self.coll.find_one({}, as_class=CustomDict) + self.assertTrue(type(doc) is CustomDict) @defer.inlineCallbacks def tearDown(self):