예제 #1
0
    def setUp(self):
        setup_test_environment()
        
        clear_cache()

        self.download_mock = Mock()
        self.download_mock.return_value = 'the url'
        self.old_downloader = picture_fetcher.download_thumbnail
        picture_fetcher.download_thumbnail = self.download_mock
예제 #2
0
    def setUp(self):
        clear_cache()
        setup_test_environment()

        self.mock = Mock()

        self.old_fetcher = wiki_fetcher.fetch
        wiki_fetcher.fetch = self.mock

        self.mock.return_value = \
            '<p>A paragraph which should be {}"escaped\'</p>'

        self.response = self.client.get(reverse('wiki', args=["/"]), {
            'titles': ['Angels & Demons', 'Another']
        })
예제 #3
0
    def setUp(self):
        clear_cache()
        setup_test_environment()

        self.mock = Mock()

        self.old_fetcher = wiki_fetcher.fetch
        wiki_fetcher.fetch = self.mock

        self.mock.return_value = \
            '<p>A paragraph which should be {}"escaped\'</p>'

        self.title  = urllib.quote('Angels & Demons')
        self.response = self.client.get(
            reverse('wiki', args=[self.title])
        )
예제 #4
0
    def setUp(self):
        clear_cache()
        self.users = map(
            lambda a: pyfactory.Factory.create('user'),
            xrange(6)
        )
        
        self.trackable1 = pyfactory.Factory.create('trackable')
        self.trackable2 = pyfactory.Factory.create('trackable')
        self.trackable3 = pyfactory.Factory.create('trackable')
        self.trackable4 = pyfactory.Factory.create('trackable')

        for user in self.users:
            user.review(self.trackable1, 1)
            user.review(self.trackable2, 1)
            user.review(self.trackable3, -1)
            user.review(self.trackable4, 1)