예제 #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')))