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
e58d81e0
authored
Sep 25, 2010
by
Alex Gaynor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A test for 0 item adds().
parent
e364191b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
0 deletions
+4
-0
taggit/managers.py
+2
-0
taggit/tests/tests.py
+2
-0
No files found.
taggit/managers.py
View file @
e58d81e0
...
...
@@ -132,6 +132,8 @@ class _TaggableManager(models.Manager):
if
not
isinstance
(
t
,
self
.
through
.
tag_model
())
])
tag_objs
=
set
(
tags
)
-
str_tags
# If str_tags has 0 elements Django actually optimizes that to not do a
# query. Malcolm is very smart.
existing
=
self
.
through
.
tag_model
()
.
objects
.
filter
(
name__in
=
str_tags
)
...
...
taggit/tests/tests.py
View file @
e58d81e0
...
...
@@ -125,6 +125,8 @@ class TaggableManagerTestCase(BaseTaggingTestCase):
# + 4 queries to create the intermeidary things (including SELECTs, to
# make sure we dont't double create.
self
.
assert_num_queries
(
5
,
pear
.
tags
.
add
,
"green"
,
"delicious"
)
self
.
assert_num_queries
(
0
,
pear
.
tags
.
add
)
def
test_require_pk
(
self
):
food_instance
=
self
.
food_model
()
...
...
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