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
314d234b
authored
Sep 05, 2010
by
Carl Meyer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix query reverse traversal test
parent
998ef2f6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
13 deletions
+13
-13
taggit/managers.py
+1
-1
taggit/tests/tests.py
+12
-12
No files found.
taggit/managers.py
View file @
314d234b
...
...
@@ -92,7 +92,7 @@ class TaggableManager(object):
return
self
.
through
.
objects
.
none
()
def
related_query_name
(
self
):
return
self
.
model
.
_meta
.
object_name
.
lower
()
return
self
.
model
.
_meta
.
module_name
def
m2m_reverse_name
(
self
):
return
self
.
through
.
_meta
.
get_field_by_name
(
"tag"
)[
0
]
.
column
...
...
taggit/tests/tests.py
View file @
314d234b
...
...
@@ -190,18 +190,18 @@ class TaggableManagerTestCase(BaseTaggingTestCase):
apple
.
tags
.
add
(
"juicy"
,
"juicy"
)
self
.
assert_tags_equal
(
apple
.
tags
.
all
(),
[
'juicy'
])
#
def test_query_traverse(self):
#
spot = self.pet_model.objects.create(name='Spot')
#
spike = self.pet_model.objects.create(name='Spike')
#
spot.tags.add('scary')
#
spike.tags.add('fluffy')
#
lookup_kwargs = {
# '%s__name' % self.pet_model._meta.object_name.lower()
: 'Spot'
#
}
#
self.assert_tags_equal(
# [i.tag for i in self.taggeditem_model.objects.filter(**lookup_kwargs)]
,
#
['scary']
#
)
def
test_query_traverse
(
self
):
spot
=
self
.
pet_model
.
objects
.
create
(
name
=
'Spot'
)
spike
=
self
.
pet_model
.
objects
.
create
(
name
=
'Spike'
)
spot
.
tags
.
add
(
'scary'
)
spike
.
tags
.
add
(
'fluffy'
)
lookup_kwargs
=
{
'
%
s__name'
%
self
.
pet_model
.
_meta
.
module_name
:
'Spot'
}
self
.
assert_tags_equal
(
self
.
tag_model
.
objects
.
filter
(
**
lookup_kwargs
)
,
[
'scary'
]
)
def
test_taggeditem_unicode
(
self
):
ross
=
self
.
pet_model
.
objects
.
create
(
name
=
"ross"
)
...
...
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