diff options
| author | Larry O'Neill <larryoneill@gmail.com> | 2013-10-14 20:13:14 +0100 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2013-10-14 18:12:00 -0400 |
| commit | 83b9bfea44e23c5770fa14a8921914839929233b (patch) | |
| tree | 38039b835449a0dd8d0283286f7dbcf92ce5180a /tests | |
| parent | 42a67ec1cd8cbaffd87f0a7b34714f7d4a259cfb (diff) | |
Fixed #21266 -- Fixed E201,E202 pep8 warnings.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/admin_custom_urls/tests.py | 6 | ||||
| -rw-r--r-- | tests/admin_widgets/tests.py | 4 | ||||
| -rw-r--r-- | tests/cache/tests.py | 2 | ||||
| -rw-r--r-- | tests/defaultfilters/tests.py | 4 | ||||
| -rw-r--r-- | tests/forms_tests/tests/test_fields.py | 4 | ||||
| -rw-r--r-- | tests/forms_tests/tests/test_formsets.py | 2 | ||||
| -rw-r--r-- | tests/i18n/tests.py | 4 | ||||
| -rw-r--r-- | tests/model_forms/tests.py | 2 | ||||
| -rw-r--r-- | tests/template_tests/filters.py | 22 | ||||
| -rw-r--r-- | tests/template_tests/tests.py | 26 | ||||
| -rw-r--r-- | tests/utils_tests/test_http.py | 2 | ||||
| -rw-r--r-- | tests/utils_tests/test_text.py | 4 |
12 files changed, 42 insertions, 40 deletions
diff --git a/tests/admin_custom_urls/tests.py b/tests/admin_custom_urls/tests.py index 1dc9da7efd..7b46f4848a 100644 --- a/tests/admin_custom_urls/tests.py +++ b/tests/admin_custom_urls/tests.py @@ -101,7 +101,7 @@ class CustomRedirects(TestCase): new object. Refs 8001, 18310, 19505. """ - post_data = { 'name': 'John Doe', } + post_data = {'name': 'John Doe'} self.assertEqual(Person.objects.count(), 0) response = self.client.post( reverse('admin:admin_custom_urls_person_add'), post_data) @@ -120,7 +120,7 @@ class CustomRedirects(TestCase): Person.objects.create(name='John Doe') self.assertEqual(Person.objects.count(), 1) person = Person.objects.all()[0] - post_data = { 'name': 'Jack Doe', } + post_data = {'name': 'Jack Doe'} response = self.client.post( reverse('admin:admin_custom_urls_person_change', args=[person.pk]), post_data) self.assertRedirects( @@ -131,7 +131,7 @@ class CustomRedirects(TestCase): Ensures that the ModelAdmin.response_add()'s parameter `post_url_continue` controls the redirection after an object has been created. """ - post_data = { 'name': 'SuperFast', '_continue': '1' } + post_data = {'name': 'SuperFast', '_continue': '1'} self.assertEqual(Car.objects.count(), 0) response = self.client.post( reverse('admin:admin_custom_urls_car_add'), post_data) diff --git a/tests/admin_widgets/tests.py b/tests/admin_widgets/tests.py index c75ffe5def..3613fa2207 100644 --- a/tests/admin_widgets/tests.py +++ b/tests/admin_widgets/tests.py @@ -367,7 +367,9 @@ class AdminFileWidgetTest(DjangoTestCase): w = widgets.AdminFileWidget() self.assertHTMLEqual( w.render('test', album.cover_art), - '<p class="file-upload">Currently: <a href="%(STORAGE_URL)salbums/hybrid_theory.jpg">albums\hybrid_theory.jpg</a> <span class="clearable-file-input"><input type="checkbox" name="test-clear" id="test-clear_id" /> <label for="test-clear_id">Clear</label></span><br />Change: <input type="file" name="test" /></p>' % { 'STORAGE_URL': default_storage.url('') }, + '<p class="file-upload">Currently: <a href="%(STORAGE_URL)salbums/hybrid_theory.jpg">albums\hybrid_theory.jpg</a> <span class="clearable-file-input"><input type="checkbox" name="test-clear" id="test-clear_id" /> <label for="test-clear_id">Clear</label></span><br />Change: <input type="file" name="test" /></p>' % { + 'STORAGE_URL': default_storage.url('') + }, ) self.assertHTMLEqual( diff --git a/tests/cache/tests.py b/tests/cache/tests.py index c04decbad8..ee6df48b03 100644 --- a/tests/cache/tests.py +++ b/tests/cache/tests.py @@ -353,7 +353,7 @@ class BaseCacheTests(object): 'ascii': 'ascii_value', 'unicode_ascii': 'Iñtërnâtiônàlizætiøn1', 'Iñtërnâtiônàlizætiøn': 'Iñtërnâtiônàlizætiøn2', - 'ascii2': {'x' : 1 } + 'ascii2': {'x' : 1} } # Test `set` for (key, value) in stuff.items(): diff --git a/tests/defaultfilters/tests.py b/tests/defaultfilters/tests.py index adae44dad3..d51bebcd7d 100644 --- a/tests/defaultfilters/tests.py +++ b/tests/defaultfilters/tests.py @@ -315,9 +315,9 @@ class DefaultFiltersTests(TestCase): # Check urlize handles brackets properly (#19070) self.assertEqual(urlize('[see www.example.com]'), - '[see <a href="http://www.example.com" rel="nofollow">www.example.com</a>]' ) + '[see <a href="http://www.example.com" rel="nofollow">www.example.com</a>]') self.assertEqual(urlize('see test[at[example.com'), - 'see <a href="http://test[at[example.com" rel="nofollow">test[at[example.com</a>' ) + 'see <a href="http://test[at[example.com" rel="nofollow">test[at[example.com</a>') self.assertEqual(urlize('[http://168.192.0.1](http://168.192.0.1)'), '[<a href="http://168.192.0.1](http://168.192.0.1)" rel="nofollow">http://168.192.0.1](http://168.192.0.1)</a>') diff --git a/tests/forms_tests/tests/test_fields.py b/tests/forms_tests/tests/test_fields.py index b49d8f000f..1ac2c62d66 100644 --- a/tests/forms_tests/tests/test_fields.py +++ b/tests/forms_tests/tests/test_fields.py @@ -978,7 +978,7 @@ class FieldsTests(SimpleTestCase): class HiddenNullBooleanForm(Form): hidden_nullbool1 = NullBooleanField(widget=HiddenInput, initial=True) hidden_nullbool2 = NullBooleanField(widget=HiddenInput, initial=False) - f = HiddenNullBooleanForm({ 'hidden_nullbool1': 'True', 'hidden_nullbool2': 'False' }) + f = HiddenNullBooleanForm({'hidden_nullbool1': 'True', 'hidden_nullbool2': 'False'}) self.assertEqual(None, f.full_clean()) self.assertEqual(True, f.cleaned_data['hidden_nullbool1']) self.assertEqual(False, f.cleaned_data['hidden_nullbool2']) @@ -991,7 +991,7 @@ class FieldsTests(SimpleTestCase): nullbool0 = NullBooleanField(widget=RadioSelect(choices=NULLBOOL_CHOICES)) nullbool1 = NullBooleanField(widget=RadioSelect(choices=NULLBOOL_CHOICES)) nullbool2 = NullBooleanField(widget=RadioSelect(choices=NULLBOOL_CHOICES)) - f = MySQLNullBooleanForm({ 'nullbool0': '1', 'nullbool1': '0', 'nullbool2': '' }) + f = MySQLNullBooleanForm({'nullbool0': '1', 'nullbool1': '0', 'nullbool2': ''}) self.assertEqual(None, f.full_clean()) self.assertEqual(True, f.cleaned_data['nullbool0']) self.assertEqual(False, f.cleaned_data['nullbool1']) diff --git a/tests/forms_tests/tests/test_formsets.py b/tests/forms_tests/tests/test_formsets.py index 6eadf6028d..e36d8c2b77 100644 --- a/tests/forms_tests/tests/test_formsets.py +++ b/tests/forms_tests/tests/test_formsets.py @@ -1205,7 +1205,7 @@ class TestEmptyFormSet(TestCase): """Test that an empty formset still calls clean()""" EmptyFsetWontValidateFormset = formset_factory(FavoriteDrinkForm, extra=0, formset=EmptyFsetWontValidate) formset = EmptyFsetWontValidateFormset(data={'form-INITIAL_FORMS':'0', 'form-TOTAL_FORMS':'0'},prefix="form") - formset2 = EmptyFsetWontValidateFormset(data={'form-INITIAL_FORMS':'0', 'form-TOTAL_FORMS':'1', 'form-0-name':'bah' },prefix="form") + formset2 = EmptyFsetWontValidateFormset(data={'form-INITIAL_FORMS':'0', 'form-TOTAL_FORMS':'1', 'form-0-name':'bah'},prefix="form") self.assertFalse(formset.is_valid()) self.assertFalse(formset2.is_valid()) diff --git a/tests/i18n/tests.py b/tests/i18n/tests.py index dc6c2ea5b2..6d8910bf04 100644 --- a/tests/i18n/tests.py +++ b/tests/i18n/tests.py @@ -755,7 +755,7 @@ class FormattingTests(TransRealMixin, TestCase): """ Tests the {% localize %} templatetag """ - context = Context({'value': 3.14 }) + context = Context({'value': 3.14}) template1 = Template("{% load l10n %}{% localize %}{{ value }}{% endlocalize %};{% localize on %}{{ value }}{% endlocalize %}") template2 = Template("{% load l10n %}{{ value }};{% localize off %}{{ value }};{% endlocalize %}{{ value }}") template3 = Template('{% load l10n %}{{ value }};{{ value|unlocalize }}') @@ -789,7 +789,7 @@ class FormattingTests(TransRealMixin, TestCase): 'cents_paid': decimal.Decimal('59.47'), 'products_delivered': 12000, }) - context = Context({'form': form }) + context = Context({'form': form}) self.assertTrue(form.is_valid()) self.assertHTMLEqual( diff --git a/tests/model_forms/tests.py b/tests/model_forms/tests.py index 6e23a0b676..8acc88b33f 100644 --- a/tests/model_forms/tests.py +++ b/tests/model_forms/tests.py @@ -696,7 +696,7 @@ class UniqueTest(TestCase): def test_explicitpk_unspecified(self): """Test for primary_key being in the form and failing validation.""" - form = ExplicitPKForm({'key': '', 'desc': '' }) + form = ExplicitPKForm({'key': '', 'desc': ''}) self.assertFalse(form.is_valid()) def test_explicitpk_unique(self): diff --git a/tests/template_tests/filters.py b/tests/template_tests/filters.py index 87c6429835..3addec24a7 100644 --- a/tests/template_tests/filters.py +++ b/tests/template_tests/filters.py @@ -50,10 +50,10 @@ def get_filter_tests(): 'filter-timesince06' : ('{{ a|timesince:b }}', {'a':now_tz - timedelta(hours=8), 'b':now_tz}, '8\xa0hours'), # Regression for #7443 - 'filter-timesince07': ('{{ earlier|timesince }}', { 'earlier': now - timedelta(days=7) }, '1\xa0week'), - 'filter-timesince08': ('{{ earlier|timesince:now }}', { 'now': now, 'earlier': now - timedelta(days=7) }, '1\xa0week'), - 'filter-timesince09': ('{{ later|timesince }}', { 'later': now + timedelta(days=7) }, '0\xa0minutes'), - 'filter-timesince10': ('{{ later|timesince:now }}', { 'now': now, 'later': now + timedelta(days=7) }, '0\xa0minutes'), + 'filter-timesince07': ('{{ earlier|timesince }}', {'earlier': now - timedelta(days=7)}, '1\xa0week'), + 'filter-timesince08': ('{{ earlier|timesince:now }}', {'now': now, 'earlier': now - timedelta(days=7)}, '1\xa0week'), + 'filter-timesince09': ('{{ later|timesince }}', {'later': now + timedelta(days=7)}, '0\xa0minutes'), + 'filter-timesince10': ('{{ later|timesince:now }}', {'now': now, 'later': now + timedelta(days=7)}, '0\xa0minutes'), # Ensures that differing timezones are calculated correctly # Tests trying to compare a timezone-aware 'now' to now aren't supported on no-tz-support systems (e.g Windows). @@ -78,10 +78,10 @@ def get_filter_tests(): 'filter-timeuntil05' : ('{{ a|timeuntil:b }}', {'a':now - timedelta(days=2), 'b':now - timedelta(days=2, minutes=1)}, '1\xa0minute'), # Regression for #7443 - 'filter-timeuntil06': ('{{ earlier|timeuntil }}', { 'earlier': now - timedelta(days=7) }, '0\xa0minutes'), - 'filter-timeuntil07': ('{{ earlier|timeuntil:now }}', { 'now': now, 'earlier': now - timedelta(days=7) }, '0\xa0minutes'), - 'filter-timeuntil08': ('{{ later|timeuntil }}', { 'later': now + timedelta(days=7, hours=1) }, '1\xa0week'), - 'filter-timeuntil09': ('{{ later|timeuntil:now }}', { 'now': now, 'later': now + timedelta(days=7) }, '1\xa0week'), + 'filter-timeuntil06': ('{{ earlier|timeuntil }}', {'earlier': now - timedelta(days=7)}, '0\xa0minutes'), + 'filter-timeuntil07': ('{{ earlier|timeuntil:now }}', {'now': now, 'earlier': now - timedelta(days=7)}, '0\xa0minutes'), + 'filter-timeuntil08': ('{{ later|timeuntil }}', {'later': now + timedelta(days=7, hours=1)}, '1\xa0week'), + 'filter-timeuntil09': ('{{ later|timeuntil:now }}', {'now': now, 'later': now + timedelta(days=7)}, '1\xa0week'), # Ensures that differing timezones are calculated correctly # Tests trying to compare a timezone-aware 'now' to now aren't supported on no-tz-support systems (e.g Windows). @@ -267,8 +267,8 @@ def get_filter_tests(): 'filter-default_if_none01': ('{{ a|default:"x<" }}', {"a": None}, "x<"), 'filter-default_if_none02': ('{% autoescape off %}{{ a|default:"x<" }}{% endautoescape %}', {"a": None}, "x<"), - 'filter-phone2numeric01': ('{{ a|phone2numeric }} {{ b|phone2numeric }}', {"a": "<1-800-call-me>", "b": mark_safe("<1-800-call-me>") }, "<1-800-2255-63> <1-800-2255-63>"), - 'filter-phone2numeric02': ('{% autoescape off %}{{ a|phone2numeric }} {{ b|phone2numeric }}{% endautoescape %}', {"a": "<1-800-call-me>", "b": mark_safe("<1-800-call-me>") }, "<1-800-2255-63> <1-800-2255-63>"), + 'filter-phone2numeric01': ('{{ a|phone2numeric }} {{ b|phone2numeric }}', {"a": "<1-800-call-me>", "b": mark_safe("<1-800-call-me>")}, "<1-800-2255-63> <1-800-2255-63>"), + 'filter-phone2numeric02': ('{% autoescape off %}{{ a|phone2numeric }} {{ b|phone2numeric }}{% endautoescape %}', {"a": "<1-800-call-me>", "b": mark_safe("<1-800-call-me>")}, "<1-800-2255-63> <1-800-2255-63>"), 'filter-phone2numeric03': ('{{ a|phone2numeric }}', {"a": "How razorback-jumping frogs can level six piqued gymnasts!"}, "469 729672225-5867464 37647 226 53835 749 747833 49662787!"), # Ensure iriencode keeps safe strings: @@ -347,7 +347,7 @@ def get_filter_tests(): # Test that joining with unsafe joiners don't result in unsafe strings (#11377) 'join05': (r'{{ a|join:var }}', {'a': ['alpha', 'beta & me'], 'var': ' & '}, 'alpha & beta & me'), 'join06': (r'{{ a|join:var }}', {'a': ['alpha', 'beta & me'], 'var': mark_safe(' & ')}, 'alpha & beta & me'), - 'join07': (r'{{ a|join:var|lower }}', {'a': ['Alpha', 'Beta & me'], 'var': ' & ' }, 'alpha & beta & me'), + 'join07': (r'{{ a|join:var|lower }}', {'a': ['Alpha', 'Beta & me'], 'var': ' & '}, 'alpha & beta & me'), 'join08': (r'{{ a|join:var|lower }}', {'a': ['Alpha', 'Beta & me'], 'var': mark_safe(' & ')}, 'alpha & beta & me'), 'date01': (r'{{ d|date:"m" }}', {'d': datetime(2008, 1, 1)}, '01'), diff --git a/tests/template_tests/tests.py b/tests/template_tests/tests.py index 2551d43890..353d99ee83 100644 --- a/tests/template_tests/tests.py +++ b/tests/template_tests/tests.py @@ -1102,19 +1102,19 @@ class TemplateTests(TransRealMixin, TestCase): 'ifchanged08': ('{% for data in datalist %}{% for c,d in data %}{% if c %}{% ifchanged %}{{ d }}{% endifchanged %}{% endif %}{% endfor %}{% endfor %}', {'datalist': [[(1, 'a'), (1, 'a'), (0, 'b'), (1, 'c')], [(0, 'a'), (1, 'c'), (1, 'd'), (1, 'd'), (0, 'e')]]}, 'accd'), # Test one parameter given to ifchanged. - 'ifchanged-param01': ('{% for n in num %}{% ifchanged n %}..{% endifchanged %}{{ n }}{% endfor %}', { 'num': (1,2,3) }, '..1..2..3'), - 'ifchanged-param02': ('{% for n in num %}{% for x in numx %}{% ifchanged n %}..{% endifchanged %}{{ x }}{% endfor %}{% endfor %}', { 'num': (1,2,3), 'numx': (5,6,7) }, '..567..567..567'), + 'ifchanged-param01': ('{% for n in num %}{% ifchanged n %}..{% endifchanged %}{{ n }}{% endfor %}', {'num': (1,2,3)}, '..1..2..3'), + 'ifchanged-param02': ('{% for n in num %}{% for x in numx %}{% ifchanged n %}..{% endifchanged %}{{ x }}{% endfor %}{% endfor %}', {'num': (1,2,3), 'numx': (5,6,7)}, '..567..567..567'), # Test multiple parameters to ifchanged. - 'ifchanged-param03': ('{% for n in num %}{{ n }}{% for x in numx %}{% ifchanged x n %}{{ x }}{% endifchanged %}{% endfor %}{% endfor %}', { 'num': (1,1,2), 'numx': (5,6,6) }, '156156256'), + 'ifchanged-param03': ('{% for n in num %}{{ n }}{% for x in numx %}{% ifchanged x n %}{{ x }}{% endifchanged %}{% endfor %}{% endfor %}', {'num': (1,1,2), 'numx': (5,6,6)}, '156156256'), # Test a date+hour like construct, where the hour of the last day # is the same but the date had changed, so print the hour anyway. - 'ifchanged-param04': ('{% for d in days %}{% ifchanged %}{{ d.day }}{% endifchanged %}{% for h in d.hours %}{% ifchanged d h %}{{ h }}{% endifchanged %}{% endfor %}{% endfor %}', {'days':[{'day':1, 'hours':[1,2,3]},{'day':2, 'hours':[3]},] }, '112323'), + 'ifchanged-param04': ('{% for d in days %}{% ifchanged %}{{ d.day }}{% endifchanged %}{% for h in d.hours %}{% ifchanged d h %}{{ h }}{% endifchanged %}{% endfor %}{% endfor %}', {'days':[{'day':1, 'hours':[1,2,3]},{'day':2, 'hours':[3]},]}, '112323'), # Logically the same as above, just written with explicit # ifchanged for the day. - 'ifchanged-param05': ('{% for d in days %}{% ifchanged d.day %}{{ d.day }}{% endifchanged %}{% for h in d.hours %}{% ifchanged d.day h %}{{ h }}{% endifchanged %}{% endfor %}{% endfor %}', {'days':[{'day':1, 'hours':[1,2,3]},{'day':2, 'hours':[3]},] }, '112323'), + 'ifchanged-param05': ('{% for d in days %}{% ifchanged d.day %}{{ d.day }}{% endifchanged %}{% for h in d.hours %}{% ifchanged d.day h %}{{ h }}{% endifchanged %}{% endfor %}{% endfor %}', {'days':[{'day':1, 'hours':[1,2,3]},{'day':2, 'hours':[3]},]}, '112323'), # Test the else clause of ifchanged. 'ifchanged-else01': ('{% for id in ids %}{{ id }}{% ifchanged id %}-first{% else %}-other{% endifchanged %},{% endfor %}', {'ids': [1,1,2,2,2,3]}, '1-first,1-other,2-first,2-other,2-other,3-first,'), @@ -1512,11 +1512,11 @@ class TemplateTests(TransRealMixin, TestCase): '{{ item.foo }}' '{% endfor %},' '{% endfor %}', - {'data': [ {'foo':'c', 'bar':1}, + {'data': [{'foo':'c', 'bar':1}, {'foo':'d', 'bar':1}, {'foo':'a', 'bar':2}, {'foo':'b', 'bar':2}, - {'foo':'x', 'bar':3} ]}, + {'foo':'x', 'bar':3}]}, '1:cd,2:ab,3:x,'), # Test for silent failure when target variable isn't found @@ -1640,8 +1640,8 @@ class TemplateTests(TransRealMixin, TestCase): 'widthratio16': ('{% widthratio a b 100 as variable %}-{{ variable }}-', {'a':50,'b':100}, '-50-'), 'widthratio17': ('{% widthratio a b 100 as variable %}-{{ variable }}-', {'a':100,'b':100}, '-100-'), - 'widthratio18': ('{% widthratio a b 100 as %}', { }, template.TemplateSyntaxError), - 'widthratio19': ('{% widthratio a b 100 not_as variable %}', { }, template.TemplateSyntaxError), + 'widthratio18': ('{% widthratio a b 100 as %}', {}, template.TemplateSyntaxError), + 'widthratio19': ('{% widthratio a b 100 not_as variable %}', {}, template.TemplateSyntaxError), ### WITH TAG ######################################################## 'with01': ('{% with key=dict.key %}{{ key }}{% endwith %}', {'dict': {'key': 50}}, '50'), @@ -1778,11 +1778,11 @@ class TemplateTests(TransRealMixin, TestCase): 'autoescape-filtertag01': ("{{ first }}{% filter safe %}{{ first }} x<y{% endfilter %}", {"first": "<a>"}, template.TemplateSyntaxError), # ifqeual compares unescaped vales. - 'autoescape-ifequal01': ('{% ifequal var "this & that" %}yes{% endifequal %}', { "var": "this & that" }, "yes"), + 'autoescape-ifequal01': ('{% ifequal var "this & that" %}yes{% endifequal %}', {"var": "this & that"}, "yes"), # Arguments to filters are 'safe' and manipulate their input unescaped. - 'autoescape-filters01': ('{{ var|cut:"&" }}', { "var": "this & that" }, "this that" ), - 'autoescape-filters02': ('{{ var|join:" & \" }}', { "var": ("Tom", "Dick", "Harry") }, "Tom & Dick & Harry"), + 'autoescape-filters01': ('{{ var|cut:"&" }}', {"var": "this & that"}, "this that"), + 'autoescape-filters02': ('{{ var|join:" & \" }}', {"var": ("Tom", "Dick", "Harry")}, "Tom & Dick & Harry"), # Literal strings are safe. 'autoescape-literals01': ('{{ "this & that" }}',{}, "this & that"), @@ -1791,7 +1791,7 @@ class TemplateTests(TransRealMixin, TestCase): 'autoescape-stringiterations01': ('{% for l in var %}{{ l }},{% endfor %}', {'var': 'K&R'}, "K,&,R,"), # Escape requirement survives lookup. - 'autoescape-lookup01': ('{{ var.key }}', { "var": {"key": "this & that" }}, "this & that"), + 'autoescape-lookup01': ('{{ var.key }}', {"var": {"key": "this & that"}}, "this & that"), # Static template tags 'static-prefixtag01': ('{% load static %}{% get_static_prefix %}', {}, settings.STATIC_URL), diff --git a/tests/utils_tests/test_http.py b/tests/utils_tests/test_http.py index f68ac33503..9f6bcce830 100644 --- a/tests/utils_tests/test_http.py +++ b/tests/utils_tests/test_http.py @@ -36,7 +36,7 @@ class TestUtilsHttp(unittest.TestCase): self.assertEqual(result, 'a=1&b=2&c=3') # A dictionary - result = http.urlencode({ 'a': 1, 'b': 2, 'c': 3}) + result = http.urlencode({'a': 1, 'b': 2, 'c': 3}) acceptable_results = [ # Need to allow all of these as dictionaries have to be treated as # unordered diff --git a/tests/utils_tests/test_text.py b/tests/utils_tests/test_text.py index 62f1333517..1b1642e2ce 100644 --- a/tests/utils_tests/test_text.py +++ b/tests/utils_tests/test_text.py @@ -76,11 +76,11 @@ class TestUtilsText(SimpleTestCase): truncator = text.Truncator('<br/>The <hr />quick brown fox jumped over' ' the lazy dog.') self.assertEqual('<br/>The <hr />quick brown...', - truncator.words(3, '...', html=True )) + truncator.words(3, '...', html=True)) truncator = text.Truncator('<br>The <hr/>quick <em>brown fox</em> ' 'jumped over the lazy dog.') self.assertEqual('<br>The <hr/>quick <em>brown...</em>', - truncator.words(3, '...', html=True )) + truncator.words(3, '...', html=True)) # Test html entities truncator = text.Truncator('<i>Buenos días!' |
