예제 #1
0
    def test_addAddress(self):
        """
        Test that L{smtpout.FromAddressConfigFragment.addAddress} creates
        L{smtpout.FromAddress} items with the right attribute values
        """
        attrs = dict(address=u'foo@bar',
                     smtpHost=u'bar',
                     smtpUsername=u'foo',
                     smtpPort=25,
                     smtpPassword=u'secret')

        self.frag.addAddress(default=False, **attrs)
        item = self.store.findUnique(smtpout.FromAddress,
                                     smtpout.FromAddress._default == False)
        for (k, v) in attrs.iteritems():
            self.assertEquals(getattr(item, k), v)
        item.deleteFromStore()

        self.frag.addAddress(default=True, **attrs)
        item = self.store.findUnique(smtpout.FromAddress,
                                     smtpout.FromAddress._default == True)
        for (k, v) in attrs.iteritems():
            self.assertEquals(getattr(item, k), v)
        # make sure it did
        self.assertEquals(smtpout.FromAddress.findDefault(self.store), item)
예제 #2
0
    def test_addAddress(self):
        """
        Test that L{smtpout.FromAddressConfigFragment.addAddress} creates
        L{smtpout.FromAddress} items with the right attribute values
        """
        attrs = dict(address=u'foo@bar',
                     smtpHost=u'bar',
                     smtpUsername=u'foo',
                     smtpPort=25,
                     smtpPassword=u'secret')

        self.frag.addAddress(default=False, **attrs)
        item = self.store.findUnique(smtpout.FromAddress,
                                     smtpout.FromAddress._default == False)
        for (k, v) in attrs.iteritems():
            self.assertEquals(getattr(item, k), v)
        item.deleteFromStore()

        self.frag.addAddress(default=True, **attrs)
        item = self.store.findUnique(smtpout.FromAddress,
                                     smtpout.FromAddress._default == True)
        for (k, v) in attrs.iteritems():
            self.assertEquals(getattr(item, k), v)
        # make sure it did
        self.assertEquals(smtpout.FromAddress.findDefault(self.store), item)
예제 #3
0
파일: web.py 프로젝트: mediamatic/ikdisplay
    def api_removeItem(self, request):
        """ Removes the item {id} from the database. """

        item = self.api_getItem(request)

        # Cleanup
        if (source.IPubSubEventProcessor.providedBy(item)):
            self.pubsubDispatcher.removeObserver(item)

        if hasattr(item, 'terms') and hasattr(item, 'userIDs'):
            self.twitterDispatcher.refreshFilters()

        item.deleteFromStore(True)
        return {"status": "deleted"}
예제 #4
0
 def delete(item):
     item.deleteFromStore()
예제 #5
0
 def action_delete(self, item):
     """
     Delete the given L{FromAddress}
     """
     item.deleteFromStore()
예제 #6
0
파일: test_item.py 프로젝트: bne/squeal
 def delete(item):
     item.deleteFromStore()
예제 #7
0
 def action_delete(self, item):
     """
     Delete the given L{FromAddress}
     """
     item.deleteFromStore()