Skip to content

Commit 4e9ae60

Browse files
committed
add tests for nested dict filtering
Signed-off-by: Drew Shafer <[email protected]>
1 parent aa4c70c commit 4e9ae60

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

tests/tests.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@ def test_dict_endpoint(self):
4040
"pk": 1,
4141
"int_field": 1,
4242
"__expandable__": ["expandable_dict", "expandable_string"],
43+
},
44+
"deep_test": {
45+
"test": {
46+
"pk": 1,
47+
"int_field": 1,
48+
"__expandable__": ["expandable_dict", "expandable_string"],
49+
},
4350
}
4451
},
4552
)

tests/views.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,8 @@ def is_authorized(self):
4242

4343
@endpoint_resource(type=TestModel)
4444
def resource(self):
45-
return {"test": TestModel.objects.create(int_field=1)}
45+
inst = TestModel.objects.create(int_field=1)
46+
return {"test": inst,
47+
"deep_test": {
48+
"test": inst
49+
}}

0 commit comments

Comments
 (0)