Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
django-taggit
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
1baa050f
authored
Jun 03, 2010
by
Alex Gaynor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Display tags in sorted order, so tests can pass as well (under postgres)
parent
e04918d6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
5 deletions
+4
-5
taggit/tests/tests.py
+3
-4
taggit/utils.py
+1
-1
No files found.
taggit/tests/tests.py
View file @
1baa050f
...
@@ -215,7 +215,7 @@ class TaggableFormTestCase(BaseTaggingTestCase):
...
@@ -215,7 +215,7 @@ class TaggableFormTestCase(BaseTaggingTestCase):
apple
.
tags
.
add
(
'has,comma'
)
apple
.
tags
.
add
(
'has,comma'
)
f
=
self
.
form_class
(
instance
=
apple
)
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 "has,comma"
" 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="
"has,comma" delicious green red yummy
" id="id_tags" /></td></tr>"""
)
class
TaggableFormDirectTestCase
(
TaggableFormTestCase
):
class
TaggableFormDirectTestCase
(
TaggableFormTestCase
):
...
@@ -307,7 +307,6 @@ class TagStringParseTestCase(UnitTestCase):
...
@@ -307,7 +307,6 @@ class TagStringParseTestCase(UnitTestCase):
comma
=
Tag
.
objects
.
create
(
name
=
'com,ma'
)
comma
=
Tag
.
objects
.
create
(
name
=
'com,ma'
)
self
.
assertEqual
(
edit_string_for_tags
([
plain
]),
u'plain'
)
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
]),
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
,
spaces
,
comma
]),
u'
"com,ma", plain, spa ces
'
)
self
.
assertEqual
(
edit_string_for_tags
([
plain
,
comma
]),
u'
plain "com,ma"
'
)
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'
)
self
.
assertEqual
(
edit_string_for_tags
([
comma
,
spaces
]),
u'"com,ma", spa ces'
)
taggit/utils.py
View file @
1baa050f
...
@@ -122,7 +122,7 @@ def edit_string_for_tags(tags):
...
@@ -122,7 +122,7 @@ def edit_string_for_tags(tags):
glue
=
u', '
glue
=
u', '
else
:
else
:
glue
=
u' '
glue
=
u' '
return
glue
.
join
(
names
)
return
glue
.
join
(
sorted
(
names
)
)
def
require_instance_manager
(
func
):
def
require_instance_manager
(
func
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment