Skip to content

Commit 9358f44

Browse files
committed
Test and remove unncessary clean
1 parent 0d28dfc commit 9358f44

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

tagging/forms.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ class TagField(forms.CharField):
3333
"""
3434
def clean(self, value):
3535
value = super(TagField, self).clean(value)
36-
if value == '':
37-
return value
3836
for tag_name in parse_tag_input(value):
3937
if len(tag_name) > settings.MAX_TAG_LENGTH:
4038
raise forms.ValidationError(

tagging/tests/tests.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1021,7 +1021,8 @@ def test_recreation_of_tag_list_string_representations(self):
10211021
'"com,ma", spa ces')
10221022

10231023
def test_tag_d_validation(self):
1024-
t = TagField()
1024+
t = TagField(required=False)
1025+
self.assertEqual(t.clean(''), '')
10251026
self.assertEqual(t.clean('foo'), 'foo')
10261027
self.assertEqual(t.clean('foo bar baz'), 'foo bar baz')
10271028
self.assertEqual(t.clean('foo,bar,baz'), 'foo,bar,baz')

0 commit comments

Comments
 (0)