Skip to content

Commit 263abd0

Browse files
committed
Update for new spec changes
1 parent d9ae14e commit 263abd0

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

tests/performance/odm-data/flat_models/large_doc.json

Lines changed: 7 additions & 1 deletion
Large diffs are not rendered by default.

tests/performance/perftest/models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ class LargeFlatModel(models.Model):
297297
field248 = models.IntegerField()
298298
field249 = models.IntegerField()
299299
field250 = models.IntegerField()
300+
image_field = models.BinaryField()
300301

301302

302303
class StringEmbeddedModel(EmbeddedModel):

tests/performance/perftest/tests.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
import warnings
2929
from pathlib import Path
3030

31-
from bson import ObjectId, encode
31+
from bson import ObjectId, encode, json_util
3232
from django.test import (
3333
TestCase,
3434
)
@@ -169,7 +169,7 @@ class SmallFlatDocTest(PerformanceTest):
169169
def setUp(self):
170170
super().setUp()
171171
with open(Path(TEST_PATH) / Path("flat_models") / self.dataset) as data: # noqa: PTH123
172-
self.document = json.load(data)
172+
self.document = json_util.loads(data.read())
173173

174174
self.data_size = len(encode(self.document)) * NUM_DOCS
175175
self.documents = [self.document.copy() for _ in range(NUM_DOCS)]
@@ -252,7 +252,7 @@ class LargeFlatDocTest(PerformanceTest):
252252
def setUp(self):
253253
super().setUp()
254254
with open(Path(TEST_PATH) / Path("flat_models") / self.dataset) as data: # noqa: PTH123
255-
self.document = json.load(data)
255+
self.document = json_util.loads(data.read())
256256

257257
self.data_size = len(encode(self.document)) * NUM_DOCS
258258
self.documents = [self.document.copy() for _ in range(NUM_DOCS)]
@@ -293,7 +293,7 @@ class LargeNestedDocTest(PerformanceTest):
293293
def setUp(self):
294294
super().setUp()
295295
with open(Path(TEST_PATH) / Path("nested_models") / self.dataset) as data: # noqa: PTH123
296-
self.document = json.load(data)
296+
self.document = json_util.loads(data.read())
297297

298298
self.data_size = len(encode(self.document)) * NUM_DOCS
299299
self.documents = [self.document.copy() for _ in range(NUM_DOCS)]

0 commit comments

Comments
 (0)