Re-format all files

This commit is contained in:
Swen Kooij
2019-10-19 12:43:17 +03:00
parent 4ee1a5f487
commit 7cdd1f4490
41 changed files with 836 additions and 812 deletions

View File

@@ -25,8 +25,8 @@ class LocalizedBleachFieldTestCase(TestCase):
"""Tests the :see:LocalizedBleachField class."""
def test_pre_save(self):
"""Tests whether the :see:pre_save function
bleaches all values in a :see:LocalizedValue."""
"""Tests whether the :see:pre_save function bleaches all values in a
:see:LocalizedValue."""
value = self._get_test_value()
model, field = self._get_test_model(value)
@@ -35,8 +35,8 @@ class LocalizedBleachFieldTestCase(TestCase):
self._validate(value, bleached_value)
def test_pre_save_none(self):
"""Tests whether the :see:pre_save function
works properly when specifying :see:None."""
"""Tests whether the :see:pre_save function works properly when
specifying :see:None."""
model, field = self._get_test_model(None)
@@ -44,9 +44,8 @@ class LocalizedBleachFieldTestCase(TestCase):
assert not bleached_value
def test_pre_save_none_values(self):
"""Tests whether the :see:pre_save function
works properly when one of the languages has
no text and is None."""
"""Tests whether the :see:pre_save function works properly when one of
the languages has no text and is None."""
value = self._get_test_value()
value.set(settings.LANGUAGE_CODE, None)
@@ -58,14 +57,13 @@ class LocalizedBleachFieldTestCase(TestCase):
@staticmethod
def _get_test_model(value):
"""Gets a test model and a artifically
constructed :see:LocalizedBleachField
instance to test with."""
"""Gets a test model and a artifically constructed
:see:LocalizedBleachField instance to test with."""
model = TestModel(value)
field = LocalizedBleachField()
field.attname = 'value'
field.attname = "value"
return model, field
@staticmethod
@@ -75,14 +73,14 @@ class LocalizedBleachFieldTestCase(TestCase):
value = LocalizedValue()
for lang_code, lang_name in settings.LANGUAGES:
value.set(lang_code, '<script>%s</script>' % lang_name)
value.set(lang_code, "<script>%s</script>" % lang_name)
return value
@staticmethod
def _validate(non_bleached_value, bleached_value):
"""Validates whether the specified non-bleached
value ended up being correctly bleached.
"""Validates whether the specified non-bleached value ended up being
correctly bleached.
Arguments:
non_bleached_value:
@@ -98,8 +96,7 @@ class LocalizedBleachFieldTestCase(TestCase):
continue
expected_value = bleach.clean(
non_bleached_value.get(lang_code),
get_bleach_default_options()
non_bleached_value.get(lang_code), get_bleach_default_options()
)
assert bleached_value.get(lang_code) == expected_value