def filter_by_mock_conceptscheme(**kwargs): filter_mock = Mock() concept_scheme = ConceptScheme() concept_scheme.id = 1 concept_scheme.uri = "urn:test:test" filter_mock.one = Mock(return_value=concept_scheme) return filter_mock
def setUp(self): conceptscheme = ConceptScheme() conceptscheme.uri = 'urn:x-atramhasis-demo' conceptscheme.id = 1 self.concept = Concept() self.concept.type = 'concept' self.concept.id = 11 self.concept.concept_id = 101 self.concept.uri = 'urn:x-atramhasis-demo:TREES:101' self.concept.conceptscheme_id = 1 self.concept.conceptscheme = conceptscheme notes = [] note = Note(note='test note', notetype_id='example', language_id='en') note2 = Note(note='note def', notetype_id='definition', language_id='en') notes.append(note) notes.append(note2) self.concept.notes = notes labels = [] label = Label(label='een label', labeltype_id='prefLabel', language_id='nl') label2 = Label(label='other label', labeltype_id='altLabel', language_id='en') label3 = Label(label='and some other label', labeltype_id='altLabel', language_id='en') labels.append(label) labels.append(label2) labels.append(label3) self.concept.labels = labels matches = [] match1 = Match() match1.uri = 'urn:test' match1.concept = self.concept match1.matchtype = MatchType(name='closeMatch', description='') match2 = Match() match2.uri = 'urn:test' match2.concept = self.concept match2.matchtype = MatchType(name='closeMatch', description='') matches.append(match1) matches.append(match2) self.matches = matches self.collection = Collection() self.collection.type = 'collection' self.collection.id = 12 self.collection.concept_id = 102 self.collection.uri = 'urn:x-atramhasis-demo:TREES:102' self.collection.conceptscheme_id = 1 self.collection.conceptscheme = conceptscheme
def setUp(self): conceptscheme = ConceptScheme() conceptscheme.uri = 'urn:x-atramhasis-demo' conceptscheme.id = 1 self.concept = Concept() self.concept.type = 'concept' self.concept.id = 11 self.concept.concept_id = 101 self.concept.uri = 'urn:x-atramhasis-demo:TREES:101' self.concept.conceptscheme_id = 1 self.concept.conceptscheme = conceptscheme notes = [] note = Note(note='test note', notetype_id='example', language_id='en') note2 = Note(note='note def', notetype_id='definition', language_id='en') notes.append(note) notes.append(note2) self.concept.notes = notes labels = [] label = Label(label='een label', labeltype_id='prefLabel', language_id='nl') label2 = Label(label='other label', labeltype_id='altLabel', language_id='en') label3 = Label(label='and some other label', labeltype_id='altLabel', language_id='en') labels.append(label) labels.append(label2) labels.append(label3) self.concept.labels = labels sources = [] source = Source(citation='Kinsella S. & Carlisle P. 2015: Alice.') sources.append(source) self.concept.sources = sources matches = [] match1 = Match() match1.uri ='urn:test' match1.concept = self.concept match1.matchtype = MatchType(name='closeMatch', description='') match2 = Match() match2.uri ='urn:test' match2.concept = self.concept match2.matchtype = MatchType(name='closeMatch', description='') matches.append(match1) matches.append(match2) self.matches = matches self.collection = Collection() self.collection.type = 'collection' self.collection.id = 12 self.collection.concept_id = 102 self.collection.uri = 'urn:x-atramhasis-demo:TREES:102' self.collection.conceptscheme_id = 1 self.collection.conceptscheme = conceptscheme