Skip to content

Commit 5e6307f

Browse files
committed
refactor: Rename 'dict' to 'dict_field' in EmbeddedJsonModelWithDict for clarity
1 parent 7e08669 commit 5e6307f

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

tests/conftest.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,6 @@ def py_test_mark_sync(f):
1717
return f # no-op decorator
1818

1919

20-
@pytest.fixture(scope="session")
21-
def event_loop(request):
22-
loop = asyncio.get_event_loop_policy().new_event_loop()
23-
yield loop
24-
loop.close()
25-
26-
2720
@pytest.fixture(scope="session")
2821
def redis():
2922
yield get_redis_connection()

tests/test_json_model.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1134,7 +1134,7 @@ class TestUpdatesClass(JsonModel, index=True):
11341134
@py_test_mark_asyncio
11351135
async def test_model_with_dict():
11361136
class EmbeddedJsonModelWithDict(EmbeddedJsonModel, index=True):
1137-
dict: Dict
1137+
dict_field: Dict
11381138

11391139
class ModelWithDict(JsonModel, index=True):
11401140
embedded_model: EmbeddedJsonModelWithDict
@@ -1145,14 +1145,14 @@ class ModelWithDict(JsonModel, index=True):
11451145
inner_dict = dict()
11461146
d["foo"] = "bar"
11471147
inner_dict["bar"] = "foo"
1148-
embedded_model = EmbeddedJsonModelWithDict(dict=inner_dict)
1148+
embedded_model = EmbeddedJsonModelWithDict(dict_field=inner_dict)
11491149
item = ModelWithDict(info=d, embedded_model=embedded_model)
11501150
await item.save()
11511151

11521152
rematerialized = await ModelWithDict.find(ModelWithDict.pk == item.pk).first()
11531153
assert rematerialized.pk == item.pk
11541154
assert rematerialized.info["foo"] == "bar"
1155-
assert rematerialized.embedded_model.dict["bar"] == "foo"
1155+
assert rematerialized.embedded_model.dict_field["bar"] == "foo"
11561156

11571157

11581158
@py_test_mark_asyncio

0 commit comments

Comments
 (0)