Commit 1baa050f by Alex Gaynor

Display tags in sorted order, so tests can pass as well (under postgres)

parent e04918d6
......@@ -215,7 +215,7 @@ class TaggableFormTestCase(BaseTaggingTestCase):
apple.tags.add('has,comma')
f = self.form_class(instance=apple)
self.assertEqual(str(f), """<tr><th><label for="id_name">Name:</label></th><td><input id="id_name" type="text" name="name" value="apple" maxlength="50" /></td></tr>\n<tr><th><label for="id_tags">Tags:</label></th><td><input type="text" name="tags" value="delicious green red yummy &quot;has,comma&quot;" id="id_tags" /></td></tr>""")
self.assertEqual(str(f), """<tr><th><label for="id_name">Name:</label></th><td><input id="id_name" type="text" name="name" value="apple" maxlength="50" /></td></tr>\n<tr><th><label for="id_tags">Tags:</label></th><td><input type="text" name="tags" value="&quot;has,comma&quot; delicious green red yummy" id="id_tags" /></td></tr>""")
class TaggableFormDirectTestCase(TaggableFormTestCase):
......@@ -307,7 +307,6 @@ class TagStringParseTestCase(UnitTestCase):
comma = Tag.objects.create(name='com,ma')
self.assertEqual(edit_string_for_tags([plain]), u'plain')
self.assertEqual(edit_string_for_tags([plain, spaces]), u'plain, spa ces')
self.assertEqual(edit_string_for_tags([plain, spaces, comma]), u'plain, spa ces, "com,ma"')
self.assertEqual(edit_string_for_tags([plain, comma]), u'plain "com,ma"')
self.assertEqual(edit_string_for_tags([plain, spaces, comma]), u'"com,ma", plain, spa ces')
self.assertEqual(edit_string_for_tags([plain, comma]), u'"com,ma" plain')
self.assertEqual(edit_string_for_tags([comma, spaces]), u'"com,ma", spa ces')
......@@ -122,7 +122,7 @@ def edit_string_for_tags(tags):
glue = u', '
else:
glue = u' '
return glue.join(names)
return glue.join(sorted(names))
def require_instance_manager(func):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment