def test_person_to_pickerentry(self): # IPerson can be adpated to IPickerEntry. person = self.factory.makePerson() adapter = IPickerEntrySource(person) self.assertTrue(IPickerEntrySource.providedBy(adapter))
def get_picker_entry(item_subject, context_object, **kwargs): """Adapt `item_subject` to `IPickerEntrySource` and return its item.""" [entry] = IPickerEntrySource(item_subject).getPickerEntries( [item_subject], context_object, **kwargs) return entry
def test_projectgroup_to_picker_entry(self): projectgroup = self.factory.makeProject() adapter = IPickerEntrySource(projectgroup) self.assertTrue(IPickerEntrySource.providedBy(adapter))
def test_distribution_to_picker_entry(self): distribution = self.factory.makeDistribution() adapter = IPickerEntrySource(distribution) self.assertTrue(IPickerEntrySource.providedBy(adapter))
def test_dsp_to_picker_entry(self): dsp = self.factory.makeDistributionSourcePackage() adapter = IPickerEntrySource(dsp) self.assertTrue(IPickerEntrySource.providedBy(adapter))