Skip to content

Commit

Permalink
Make output of multilingual tests less verbose
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean Hammond committed Jun 5, 2012
1 parent ba4d37c commit f573a3a
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions ckanext/multilingual/tests/test_multilingual_plugin.py
Expand Up @@ -8,7 +8,6 @@
import routes
import paste.fixture
import pylons.test
import nose

class TestDatasetTermTranslation(ckan.tests.html_check.HtmlCheckMethods):
'''Test the translation of datasets by the multilingual_dataset plugin.
Expand Down Expand Up @@ -88,8 +87,7 @@ def test_dataset_read_translation(self):
response.mustcontain('<a href="/tag/%s">' % tag_name)
for group_name in ('david', 'roger'):
response.mustcontain('<a href="/group/%s">' % group_name)
nose.tools.assert_raises(IndexError, response.mustcontain,
'this should not be rendered')
assert 'this should not be rendered' not in response

def test_tag_read_translation(self):
'''Test the translation of tag view pages by the multilingual_tag
Expand Down Expand Up @@ -118,8 +116,7 @@ def test_tag_read_translation(self):
term])
else:
response.mustcontain(term)
nose.tools.assert_raises(IndexError, response.mustcontain,
'this should not be rendered')
assert 'this should not be rendered' not in response

def test_user_read_translation(self):
'''Test the translation of datasets on user view pages by the
Expand Down Expand Up @@ -148,8 +145,7 @@ def test_user_read_translation(self):
term])
else:
response.mustcontain(term)
nose.tools.assert_raises(IndexError, response.mustcontain,
'this should not be rendered')
assert 'this should not be rendered' not in response

def test_group_read_translation(self):
for (lang_code, translations) in (
Expand Down Expand Up @@ -184,8 +180,7 @@ def test_group_read_translation(self):
response.mustcontain(term)
for tag_name in ('123', '456', '789', 'russian', 'tolstoy'):
response.mustcontain('%s?tags=%s' % (offset, tag_name))
nose.tools.assert_raises(IndexError, response.mustcontain,
'this should not be rendered')
assert 'this should not be rendered' not in response

def test_dataset_index_translation(self):
for (lang_code, translations) in (
Expand All @@ -208,8 +203,7 @@ def test_dataset_index_translation(self):
response.mustcontain('/%s/dataset?tags=%s' % (lang_code, tag_name))
for group_name in ('david', 'roger'):
response.mustcontain('/%s/dataset?groups=%s' % (lang_code, group_name))
nose.tools.assert_raises(IndexError, response.mustcontain,
'this should not be rendered')
assert 'this should not be rendered' not in response

def test_group_index_translation(self):
for (lang_code, translations) in (
Expand All @@ -235,8 +229,7 @@ def test_group_index_translation(self):
response.mustcontain(term)
for group_name in ('david', 'roger'):
response.mustcontain('/%s/group/%s' % (lang_code, group_name))
nose.tools.assert_raises(IndexError, response.mustcontain,
'this should not be rendered')
assert 'this should not be rendered' not in response

def test_tag_index_translation(self):
for (lang_code, translations) in (
Expand All @@ -262,8 +255,7 @@ def test_tag_index_translation(self):
else:
response.mustcontain(term)
response.mustcontain('/%s/tag/%s' % (lang_code, term))
nose.tools.assert_raises(IndexError, response.mustcontain,
'this should not be rendered')
assert 'this should not be rendered' not in response

class TestDatasetSearchIndex():

Expand Down

0 comments on commit f573a3a

Please sign in to comment.