def test_nonstandard_type_vocab(self): ar = ActionRelationship() ar.type = ActionType("AddedMultipleTimes") ar.type.vocab_reference = "http://example.com/action-types/" ar.type.xsi_type = None ar2 = round_trip(ar) self.assertEqual(ar.to_dict(), ar2.to_dict())
def test_nonstandard_type_vocab(self): ar = ActionRelationship() ar.type = VocabString(u"AddedMultipleTimes") ar.type.vocab_reference = "http://example.com/action-types/" ar.type.xsi_type = None ar2 = round_trip(ar) self.assertEqual(ar.to_dict(), ar2.to_dict())
def create_action_relationship(self,type=None,action_references=None): actionrelationship = ActionRelationship() actionrelationship.type =type if action_references is not None: for actionref in action_references: actionrelationship.action_references.append(actionref) return actionrelationship