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
09649b88
authored
Dec 31, 2009
by
Alex Gaynor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correct a bunch of test failures under MySQL. Refs #3.
parent
5d6a9964
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
taggit/managers.py
+1
-1
taggit/tests/tests.py
+2
-2
No files found.
taggit/managers.py
View file @
09649b88
...
...
@@ -59,7 +59,7 @@ class TaggableManager(object):
elif
all
(
isinstance
(
v
,
(
int
,
long
))
for
v
in
value
):
# This one is really ackward, just don't do it. The ORM does it
# for deletes, but no one else gets to.
qs
=
TaggedItem
.
objects
.
filter
(
pk__in
=
value
)
return
value
else
:
# Fucking flip-floppers.
raise
ValueError
(
"You can't combine Tag objects and strings. '
%
s' was provided."
%
value
)
...
...
taggit/tests/tests.py
View file @
09649b88
...
...
@@ -7,7 +7,7 @@ from taggit.tests.models import Food, Pet
class
BaseTaggingTest
(
TestCase
):
def
assert_tags_equal
(
self
,
qs
,
tags
):
self
.
assertEqual
(
map
(
lambda
tag
:
tag
.
name
,
qs
),
list
(
tags
))
self
.
assertEqual
(
sorted
(
map
(
lambda
tag
:
tag
.
name
,
qs
)),
sorted
(
list
(
tags
)
))
class
AddTagTestCase
(
BaseTaggingTest
):
...
...
@@ -30,7 +30,7 @@ class AddTagTestCase(BaseTaggingTest):
self
.
assert_tags_equal
(
Food
.
tags
.
all
(),
[
'green'
,
'red'
])
self
.
assert_tags_equal
(
Food
.
tags
.
most_common
(),
[
'green'
,
'red'
])
apple
.
tags
.
remove
(
'green'
)
self
.
assert_tags_equal
(
apple
.
tags
.
all
(),
[
'red'
])
self
.
assert_tags_equal
(
Food
.
tags
.
all
(),
[
'green'
,
'red'
])
...
...
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