()
| 154 | |
| 155 | |
| 156 | def test_two_way_nesting(): |
| 157 | a_obj = A(1) |
| 158 | b_obj = B(2, a=a_obj) |
| 159 | a_obj.b = b_obj |
| 160 | |
| 161 | a_serialized = ASchema().dump(a_obj) |
| 162 | b_serialized = BSchema().dump(b_obj) |
| 163 | assert a_serialized["b"]["id"] == b_obj.id |
| 164 | assert b_serialized["a"]["id"] == a_obj.id |
| 165 | |
| 166 | |
| 167 | def test_nesting_with_class_name_many(): |