コード例 #1
0
ファイル: test.py プロジェクト: Jc2k/tralchemy
 def test_delete(self):
     """ Should be able to delete objects """
     from tralchemy.nmo import FeedMessage
     self.test_inject_feed()
     a = 0
     for msg in FeedMessage.get():
         a += 1
         msg.delete()
     self.failUnless(a > 0)
     b = 0
     for msg in FeedMessage.get():
         b += 1
     self.failUnlessEqual(b, 0)
コード例 #2
0
ファイル: test.py プロジェクト: Jc2k/tralchemy
    def test_inject_feed(self):
        """ Should be able to commit objects """
        from tralchemy.nmo import FeedMessage
        feedmsg = FeedMessage("http://localhost/feed/%s" % str(uuid.uuid4()))
        today = datetime.datetime.today()
        date = today.isoformat() + "+00:00"

        feedmsg.contentlastmodified = date
        feedmsg.communicationchannel = "http://planet.gnome.org/atom.xml"
        feedmsg.title = "Your face"
        feedmsg.commit()