From 1e59c5aacfe8285cf38d1b5490a7689ed992f17a Mon Sep 17 00:00:00 2001 From: Jeff Balogh Date: Mon, 13 Jun 2011 14:20:20 -0700 Subject: [PATCH] removing remove_extra_cats tests --- apps/amo/tests/test_cron.py | 43 +------------------------------------ 1 file changed, 1 insertion(+), 42 deletions(-) diff --git a/apps/amo/tests/test_cron.py b/apps/amo/tests/test_cron.py index e544dc05ef..620c57e8ec 100644 --- a/apps/amo/tests/test_cron.py +++ b/apps/amo/tests/test_cron.py @@ -4,7 +4,7 @@ from nose.tools import eq_ import test_utils import amo -from amo.cron import gc, remove_extra_cats +from amo.cron import gc from addons.models import Addon, AddonCategory, Category from bandwagon.models import Collection from cake.models import Session @@ -40,44 +40,3 @@ class GarbageTest(test_utils.TestCase): assert Addon.objects.filter(status=0, highest_status=0) gc() assert not Addon.objects.filter(status=0, highest_status=0) - - -class RemoveExtraCatTest(test_utils.TestCase): - fixtures = ['base/category'] - - def setUp(self): - self.misc = Category.objects.create(misc=True, name='misc', - type=amo.ADDON_EXTENSION, - application_id=amo.FIREFOX.id) - self.regular = [] - for i in xrange(3): - self.regular.append(Category.objects.create( - name='normal_%d' % i, application_id=amo.FIREFOX.id, - type=amo.ADDON_EXTENSION)) - self.addon = Addon.objects.create(type=amo.ADDON_EXTENSION) - - def test_remove_others(self): - eq_(self.addon.categories.count(), 0) - AddonCategory.objects.create(addon=self.addon, category=self.misc) - AddonCategory.objects.create(addon=self.addon, - category=self.regular[0]) - eq_(self.addon.categories.count(), 2) - remove_extra_cats() - eq_(self.addon.categories.count(), 1) - eq_(unicode(self.addon.categories.get().name), 'normal_0') - - def test_remove_extras(self): - eq_(self.addon.categories.count(), 0) - for cat in self.regular: - AddonCategory.objects.create(addon=self.addon, category=cat) - eq_(self.addon.categories.count(), 3) - remove_extra_cats() - eq_(self.addon.categories.count(), 2) - - def test_noop(self): - eq_(self.addon.categories.count(), 0) - for cat in self.regular[:2]: - AddonCategory.objects.create(addon=self.addon, category=cat) - eq_(self.addon.categories.count(), 2) - remove_extra_cats() - eq_(self.addon.categories.count(), 2)