From b7d772dfc32a87d8957ac753b05daaf45aa35a31 Mon Sep 17 00:00:00 2001 From: volpino Date: Sat, 14 Jul 2012 16:43:12 +0200 Subject: [PATCH] euscanwww: Tests unwatch too Signed-off-by: volpino --- euscanwww/djeuscan/tests/test_views.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/euscanwww/djeuscan/tests/test_views.py b/euscanwww/djeuscan/tests/test_views.py index 5b6f30d..4d9ce4b 100644 --- a/euscanwww/djeuscan/tests/test_views.py +++ b/euscanwww/djeuscan/tests/test_views.py @@ -73,6 +73,10 @@ class PackageTests(SystemTestCase): self.assertIn(self.package.name, response.content) + self.post("unfavourite_package", category=self.package.category, + package=self.package.name) + self.assertEqual(PackageAssociation.objects.count(), 0) + class SectionTests(SystemTestCase): def _check_table(self, response, items, attr=None): @@ -134,6 +138,9 @@ class CategoriesTests(SectionTests): self._check_table(response, [category]) + self.post("unfavourite_category", category=category) + self.assertEqual(CategoryAssociation.objects.count(), 0) + class HerdsTests(SectionTests): def setUp(self): @@ -180,6 +187,9 @@ class HerdsTests(SectionTests): self._check_table(response, [herd], attr="herd") + self.post("unfavourite_herd", herd=herd.herd) + self.assertEqual(HerdAssociation.objects.count(), 0) + class MaintainersTests(SectionTests): def setUp(self): @@ -226,6 +236,9 @@ class MaintainersTests(SectionTests): self._check_table(response, [maintainer], attr="name") + self.post("unfavourite_maintainer", maintainer_id=maintainer.pk) + self.assertEqual(MaintainerAssociation.objects.count(), 0) + class OverlayTests(SectionTests): def setUp(self):