(self)
| 1038 | Group.drop_collection() |
| 1039 | |
| 1040 | def test_multidirectional_lists(self): |
| 1041 | class Asset(Document): |
| 1042 | name = StringField(max_length=250, required=True) |
| 1043 | path = StringField() |
| 1044 | title = StringField() |
| 1045 | parent = GenericReferenceField(default=None) |
| 1046 | parents = ListField(GenericReferenceField()) |
| 1047 | children = ListField(GenericReferenceField()) |
| 1048 | |
| 1049 | Asset.drop_collection() |
| 1050 | |
| 1051 | root = Asset(name="", path="/", title="Site Root") |
| 1052 | root.save() |
| 1053 | |
| 1054 | company = Asset(name="company", title="Company", parent=root, parents=[root]) |
| 1055 | company.save() |
| 1056 | |
| 1057 | root.children = [company] |
| 1058 | root.save() |
| 1059 | |
| 1060 | root = root.reload() |
| 1061 | assert root.children == [company] |
| 1062 | assert company.parents == [root] |
| 1063 | |
| 1064 | def test_dict_in_dbref_instance(self): |
| 1065 | class Person(Document): |
nothing calls this directly
no test coverage detected