示例#1
0
文件: forms.py 项目: kmshi/miroguide
 def save_channel(self, creator, feed_url):
     if Channel.objects.filter(url=feed_url).count():
         raise forms.ValidationError(_("Feed URL already exists"))
     channel = Channel()
     channel.url = feed_url
     channel.owner = creator
     self.update_channel(channel)
     return channel
示例#2
0
 def save_channel(self, creator, feed_url):
     if Channel.objects.filter(url=feed_url).count():
         raise forms.ValidationError(_("Feed URL already exists"))
     channel = Channel()
     channel.url = feed_url
     channel.owner = creator
     self.update_channel(channel)
     return channel
示例#3
0
文件: tests.py 项目: kmshi/miroguide
 def test_thumbnail_before_save(self):
     c = Channel()
     c.url = "http://myblog.com/videos/rss"
     c.website_url = "http://myblog.com/"
     c.publisher = "TestVision"
     c.description = "lots of stuff"
     self.assertRaises(ValueError, c.save_thumbnail,
                       file(test_data_path('thumbnail.jpg')))
示例#4
0
 def test_thumbnail_before_save(self):
     c = Channel()
     c.url = "http://myblog.com/videos/rss"
     c.website_url = "http://myblog.com/"
     c.publisher = "TestVision"
     c.description = "lots of stuff"
     self.assertRaises(ValueError, c.save_thumbnail,
                       file(test_data_path('thumbnail.jpg')))