Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' into fix-entry-import-219

Conflicts:
	zinnia/tests/entry.py
  • Loading branch information...
commit 359fb82f5c79fbc1cd5529dfe5fc727d7bd7e008 2 parents 98828b9 + 56a582c
@Fantomas42 authored
View
3  docs/extensions/zinnia_docs.py
@@ -12,7 +12,8 @@
def skip_model_member(app, what, name, obj, skip, options):
# These fields always fails !
- if name in ('tags', 'image'):
+ if name in ('tags', 'image',
+ 'next_entry', 'previous_entry'):
return True
return skip
View
10 zinnia/tests/entry.py
@@ -318,13 +318,9 @@ def test_get_entry_base_model(self):
self.assertEquals(get_entry_base_model(), AbstractEntry)
entry_models.ENTRY_BASE_MODEL = 'mymodule.myclass'
- try:
- with warnings.catch_warnings(record=True) as w:
- self.assertEquals(get_entry_base_model(), AbstractEntry)
- self.assertTrue(issubclass(w[-1].category, RuntimeWarning))
- except AttributeError:
- # Fail under Python2.5, because of'warnings.catch_warnings'
- pass
+ with warnings.catch_warnings(record=True) as w:
+ self.assertEquals(get_entry_base_model(), AbstractEntry)
+ self.assertTrue(issubclass(w[-1].category, RuntimeWarning))
entry_models.ENTRY_BASE_MODEL = 'zinnia.models.entry.AbstractEntry'
self.assertEquals(get_entry_base_model(), AbstractEntry)
View
34 zinnia/tests/spam_checker.py
@@ -11,28 +11,20 @@ class SpamCheckerTestCase(TestCase):
"""Test cases for zinnia.spam_checker"""
def test_get_spam_checker(self):
- try:
- with warnings.catch_warnings(record=True) as w:
- self.assertEquals(get_spam_checker('mymodule.myclass'), None)
- self.assertTrue(issubclass(w[-1].category, RuntimeWarning))
- self.assertEquals(
- str(w[-1].message),
- 'mymodule.myclass backend cannot be imported')
- except AttributeError:
- # Fail under Python2.5, because of'warnings.catch_warnings'
- pass
+ with warnings.catch_warnings(record=True) as w:
+ self.assertEquals(get_spam_checker('mymodule.myclass'), None)
+ self.assertTrue(issubclass(w[-1].category, RuntimeWarning))
+ self.assertEquals(
+ str(w[-1].message),
+ 'mymodule.myclass backend cannot be imported')
- try:
- with warnings.catch_warnings(record=True) as w:
- self.assertEquals(
- get_spam_checker('zinnia.tests.custom_spam_checker'), None)
- self.assertTrue(issubclass(w[-1].category, RuntimeWarning))
- self.assertEquals(
- str(w[-1].message),
- 'This backend only exists for testing')
- except AttributeError:
- # Fail under Python2.5, because of'warnings.catch_warnings'
- pass
+ with warnings.catch_warnings(record=True) as w:
+ self.assertEquals(
+ get_spam_checker('zinnia.tests.custom_spam_checker'), None)
+ self.assertTrue(issubclass(w[-1].category, RuntimeWarning))
+ self.assertEquals(
+ str(w[-1].message),
+ 'This backend only exists for testing')
self.assertEquals(
get_spam_checker('zinnia.spam_checker.backends.all_is_spam'),
View
32 zinnia/tests/url_shortener.py
@@ -19,28 +19,20 @@ def tearDown(self):
def test_get_url_shortener(self):
us_settings.URL_SHORTENER_BACKEND = 'mymodule.myclass'
- try:
- with warnings.catch_warnings(record=True) as w:
- self.assertEquals(get_url_shortener(), default_backend)
- self.assertTrue(issubclass(w[-1].category, RuntimeWarning))
- self.assertEquals(
- str(w[-1].message),
- 'mymodule.myclass backend cannot be imported')
- except AttributeError:
- # Fail under Python2.5, because of'warnings.catch_warnings'
- pass
+ with warnings.catch_warnings(record=True) as w:
+ self.assertEquals(get_url_shortener(), default_backend)
+ self.assertTrue(issubclass(w[-1].category, RuntimeWarning))
+ self.assertEquals(
+ str(w[-1].message),
+ 'mymodule.myclass backend cannot be imported')
us_settings.URL_SHORTENER_BACKEND = 'zinnia.tests.custom_url_shortener'
- try:
- with warnings.catch_warnings(record=True) as w:
- self.assertEquals(get_url_shortener(), default_backend)
- self.assertTrue(issubclass(w[-1].category, RuntimeWarning))
- self.assertEquals(
- str(w[-1].message),
- 'This backend only exists for testing')
- except AttributeError:
- # Fail under Python2.5, because of'warnings.catch_warnings'
- pass
+ with warnings.catch_warnings(record=True) as w:
+ self.assertEquals(get_url_shortener(), default_backend)
+ self.assertTrue(issubclass(w[-1].category, RuntimeWarning))
+ self.assertEquals(
+ str(w[-1].message),
+ 'This backend only exists for testing')
us_settings.URL_SHORTENER_BACKEND = 'zinnia.url_shortener'\
'.backends.default'
Please sign in to comment.
Something went wrong with that request. Please try again.