Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'document-cms-constants' into develop

  • Loading branch information...
commit 659848d3f7327574c5b61d13033edaa03c197fd7 2 parents eb884c6 + 38a9154
@ojii ojii authored
Showing with 18 additions and 16 deletions.
  1. +18 −16 cms/tests/check.py
View
34 cms/tests/check.py
@@ -26,54 +26,56 @@ def write_stderr(self, message):
class CheckTests(TestCase):
- def assertCheck(self, successful, errors, successes, skips, warnings):
+ def assertCheck(self, successful, **assertions):
+ """
+ asserts that checks are successful or not
+ Assertions is a mapping of numbers to check (eg successes=5)
+ """
output = TestOutput()
check(output)
self.assertEqual(output.successful, successful)
- self.assertEqual(output.errors, errors)
- self.assertEqual(output.successes, successes)
- self.assertEqual(output.skips, skips)
- self.assertEqual(output.warnings, warnings)
+ for key, value in assertions.items():
+ self.assertEqual(getattr(output, key), value, "%s %s expected, got %s" % (value, key, getattr(output, key)))
def test_test_confs(self):
- self.assertCheck(True, 0, 7, 1, 0)
+ self.assertCheck(True, errors=0, warnings=0)
def test_cms_moderator_deprecated(self):
with SettingsOverride(CMS_MODERATOR=True):
- self.assertCheck(True, 0, 7, 0, 1)
+ self.assertCheck(True, warnings=1, errors=0)
def test_cms_flat_urls_deprecated(self):
with SettingsOverride(CMS_FLAT_URLS=True):
- self.assertCheck(True, 0, 7, 0, 1)
+ self.assertCheck(True, warnings=1, errors=0)
def test_no_sekizai(self):
with SettingsOverride(INSTALLED_APPS=[]):
- self.assertCheck(False, 2, 5, 1, 0)
+ self.assertCheck(False, errors=2)
def test_no_sekizai_template_context_processor(self):
with SettingsOverride(TEMPLATE_CONTEXT_PROCESSORS=[]):
- self.assertCheck(False, 2, 5, 1, 0)
+ self.assertCheck(False, errors=2)
def test_old_style_i18n_settings(self):
with SettingsOverride(CMS_LANGUAGES=[('en', 'English')]):
- self.assertCheck(True, 0, 6, 1, 1)
+ self.assertCheck(True, warnings=1, errors=0)
def test_cms_hide_untranslated_deprecated(self):
with SettingsOverride(CMS_HIDE_UNTRANSLATED=True):
- self.assertCheck(True, 0, 7, 1, 1)
+ self.assertCheck(True, warnings=1, errors=0)
def test_cms_language_fallback_deprecated(self):
with SettingsOverride(CMS_LANGUAGE_FALLBACK=True):
- self.assertCheck(True, 0, 7, 1, 1)
+ self.assertCheck(True, warnings=1, errors=0)
def test_cms_language_conf_deprecated(self):
with SettingsOverride(CMS_LANGUAGE_CONF=True):
- self.assertCheck(True, 0, 7, 1, 1)
+ self.assertCheck(True, warnings=1, errors=0)
def test_cms_site_languages_deprecated(self):
with SettingsOverride(CMS_SITE_LANGUAGES=True):
- self.assertCheck(True, 0, 7, 1, 1)
+ self.assertCheck(True, warnings=1, errors=0)
def test_cms_frontend_languages_deprecated(self):
with SettingsOverride(CMS_FRONTEND_LANGUAGES=True):
- self.assertCheck(True, 0, 7, 1, 1)
+ self.assertCheck(True, warnings=1, errors=0 )
Please sign in to comment.
Something went wrong with that request. Please try again.