Did I find the right examples for you? yes no

All Samples(10)  |  Call(10)  |  Derive(0)  |  Import(0)

src/c/o/comics-HEAD/comics/aggregator/command.py   comics(Download)
    def _get_comic_by_slug(self, comic_slug):
        from comics.core.models import Comic
        try:
            comic = Comic.objects.get(slug=comic_slug)
        except Comic.DoesNotExist:

src/c/o/comics-HEAD/comics/core/comic_data.py   comics(Download)
    def create_comic(self):
        if self.is_previously_loaded():
            comic = Comic.objects.get(slug=self.slug)
            comic.name = self.name
            comic.language = self.language

src/c/o/comics-HEAD/comics/aggregator/tests/test_command.py   comics(Download)
    def test_get_comic_by_slug_valid(self):
        expected = Comic.objects.get(slug='xkcd')
        result = self.cc._get_comic_by_slug('xkcd')
        self.assertEquals(expected, result)
 
    def test_get_comic_by_slug_invalid(self):
        self.assertRaises(ComicsError, self.cc._get_comic_by_slug, 'not slug')
 
    def test_set_comics_to_crawl_two(self):
        comic1 = Comic.objects.get(slug='xkcd')
    def test_set_comics_to_crawl_two(self):
        comic1 = Comic.objects.get(slug='xkcd')
        comic2 = Comic.objects.get(slug='sinfest')
        self.cc.set_comics_to_crawl(['xkcd', 'sinfest'])
        self.assertEquals(2, len(self.cc.comics))
    def test_get_valid_date_from_history_capable(self):
        expected = datetime.date(2008, 3, 1)
        self.crawler_mock.comic = Comic.objects.get(slug='xkcd')
        self.crawler_mock.history_capable = expected
        self.crawler_mock.current_date = datetime.date(2008, 4, 1)
    def test_get_valid_date_from_config(self):
        expected = datetime.date(2008, 3, 1)
        self.crawler_mock.comic = Comic.objects.get(slug='xkcd')
        self.crawler_mock.history_capable = datetime.date(2008, 1, 1)
        self.crawler_mock.current_date = datetime.date(2008, 4, 1)

src/c/o/comics-HEAD/comics/api/tests.py   comics(Download)
def create_subscriptions(user):
    Subscription.objects.create(
        userprofile=user.comics_profile,
        comic=Comic.objects.get(slug='geekandpoke'))
    Subscription.objects.create(
        userprofile=user.comics_profile,
        comic=Comic.objects.get(slug='xkcd'))
    def test_subscribe_to_comic(self):
        comic = Comic.objects.get(slug='bunny')
 
        data = json.dumps({'comic': '/api/v1/comics/%d/' % comic.pk})
        response = self.client.post(