Fix large update tests.
The server is less forgiving now. You can no longer update a document to larger than 16MB.
This commit is contained in:
parent
f1264ccc93
commit
cb4adb2193
@ -584,10 +584,8 @@ class TestBulk(BulkTestBase):
|
||||
self.assertEqual(self.coll.find({'x': 2}).count(), 0)
|
||||
|
||||
def test_upsert_large(self):
|
||||
# We can insert a 16MB document, using an update command a little over
|
||||
# 16MB long.
|
||||
client = self.coll.database.connection
|
||||
big = 'a' * (client.max_bson_size - 30)
|
||||
big = 'a' * (client.max_bson_size - 37)
|
||||
bulk = self.coll.initialize_ordered_bulk_op()
|
||||
bulk.find({'x': 1}).upsert().update({'$set': {'s': big}})
|
||||
result = bulk.execute()
|
||||
|
||||
@ -1859,7 +1859,7 @@ class TestCollection(unittest.TestCase):
|
||||
self.assertRaises(DocumentTooLarge, self.db.test.update,
|
||||
{"bar": "x"}, {"bar": "x" * (max_size - 14)}, w=0)
|
||||
# This will pass with OP_UPDATE or the update command.
|
||||
self.db.test.update({"bar": "x"}, {"bar": "x" * (max_size - 15)})
|
||||
self.db.test.update({"bar": "x"}, {"bar": "x" * (max_size - 32)})
|
||||
|
||||
def test_insert_large_batch(self):
|
||||
max_bson_size = self.client.max_bson_size
|
||||
|
||||
Loading…
Reference in New Issue
Block a user