예제 #1
0
파일: tests.py 프로젝트: melody40/monorepo
    def test_expand_db_attributes_catches_embed_not_found(self, get_embed):
        get_embed.side_effect = EmbedNotFoundException

        result = media_embedtype_handler(
            {'url': 'http://www.youtube.com/watch/'})

        self.assertEqual(result, '')
예제 #2
0
    def test_expand_db_attributes_catches_embed_not_found(self, get_embed):
        get_embed.side_effect = EmbedNotFoundException

        result = media_embedtype_handler(
            {'url': 'http://www.youtube.com/watch/'}
        )

        self.assertEqual(result, '')
예제 #3
0
파일: tests.py 프로젝트: melody40/monorepo
    def test_expand_db_attributes(self, get_embed):
        get_embed.return_value = Embed(
            url='http://www.youtube.com/watch/',
            max_width=None,
            type='video',
            html='test html',
            title='test title',
            author_name='test author name',
            provider_name='test provider name',
            thumbnail_url='htto://test/thumbnail.url',
            width=1000,
            height=1000,
        )

        result = media_embedtype_handler(
            {'url': 'http://www.youtube.com/watch/'})
        self.assertIn('test html', result)
예제 #4
0
    def test_expand_db_attributes(self, get_embed):
        get_embed.return_value = Embed(
            url='http://www.youtube.com/watch/',
            max_width=None,
            type='video',
            html='test html',
            title='test title',
            author_name='test author name',
            provider_name='test provider name',
            thumbnail_url='htto://test/thumbnail.url',
            width=1000,
            height=1000,
        )

        result = media_embedtype_handler(
            {'url': 'http://www.youtube.com/watch/'}
        )
        self.assertIn('test html', result)