Ejemplo n.º 1
0
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
Ejemplo n.º 2
0
 def test_person_to_pickerentry(self):
     # IPerson can be adpated to IPickerEntry.
     person = self.factory.makePerson()
     adapter = IPickerEntrySource(person)
     self.assertTrue(IPickerEntrySource.providedBy(adapter))
Ejemplo n.º 3
0
 def test_projectgroup_to_picker_entry(self):
     projectgroup = self.factory.makeProject()
     adapter = IPickerEntrySource(projectgroup)
     self.assertTrue(IPickerEntrySource.providedBy(adapter))
Ejemplo n.º 4
0
 def test_distribution_to_picker_entry(self):
     distribution = self.factory.makeDistribution()
     adapter = IPickerEntrySource(distribution)
     self.assertTrue(IPickerEntrySource.providedBy(adapter))
Ejemplo n.º 5
0
 def test_dsp_to_picker_entry(self):
     dsp = self.factory.makeDistributionSourcePackage()
     adapter = IPickerEntrySource(dsp)
     self.assertTrue(IPickerEntrySource.providedBy(adapter))
 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 test_distribution_to_picker_entry(self):
     distribution = self.factory.makeDistribution()
     adapter = IPickerEntrySource(distribution)
     self.assertTrue(IPickerEntrySource.providedBy(adapter))
 def test_projectgroup_to_picker_entry(self):
     projectgroup = self.factory.makeProject()
     adapter = IPickerEntrySource(projectgroup)
     self.assertTrue(IPickerEntrySource.providedBy(adapter))
 def test_dsp_to_picker_entry(self):
     dsp = self.factory.makeDistributionSourcePackage()
     adapter = IPickerEntrySource(dsp)
     self.assertTrue(IPickerEntrySource.providedBy(adapter))