-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# encoding: utf-8 | ||
|
||
from ckan.lib.helpers import url_for | ||
|
||
import ckan.plugins as p | ||
|
||
from nose.tools import assert_true | ||
from ckan.tests import helpers, factories | ||
|
||
|
||
class TestAudioView(helpers.FunctionalTestBase): | ||
_load_plugins = ['audio_view', 'image_view'] | ||
|
||
@helpers.change_config('ckan.views.default_views', '') | ||
def test_view_shown_on_resource_page_with_audio_url(self): | ||
app = self._get_test_app() | ||
|
||
dataset = factories.Dataset() | ||
|
||
resource = factories.Resource(package_id=dataset['id'], | ||
format='wav') | ||
|
||
resource_view = factories.ResourceView( | ||
resource_id=resource['id'], | ||
view_type='audio_view', | ||
audio_url='http://example.wav') | ||
|
||
url = url_for('resource.read', | ||
id=dataset['name'], resource_id=resource['id']) | ||
|
||
response = app.get(url) | ||
|
||
assert_true(resource_view['audio_url'] in response) |