def test_field_should_exist_if_ommitted_but_is_parent_of_omit(self): serializer = FlexFieldsModelSerializer() result = serializer._should_field_exist("employer", ["employer"], [], {"employer": ["address"]}) self.assertTrue(result)
def test_field_should_not_exist_if_not_in_sparse(self): serializer = FlexFieldsModelSerializer() result = serializer._should_field_exist("name", [], ["age"], {}) self.assertFalse(result)