Commit 09649b88 by Alex Gaynor

Correct a bunch of test failures under MySQL. Refs #3.

parent 5d6a9964
......@@ -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)
......
......@@ -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'])
......
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