From 3d4775486e0c32cccfb0c5a480f8b629aaf60e5a Mon Sep 17 00:00:00 2001 From: Dusty Phillips Date: Tue, 7 Oct 2008 11:23:23 -0400 Subject: these tests will be broken and should have some real tests written later --- main/tests.py | 49 ------------------------------------------------- 1 file changed, 49 deletions(-) delete mode 100644 main/tests.py diff --git a/main/tests.py b/main/tests.py deleted file mode 100644 index 543a0c13..00000000 --- a/main/tests.py +++ /dev/null @@ -1,49 +0,0 @@ -## test cases -from django.test import TestCase -from main.models import Package, PackageDepend -from django.contrib.auth.models import User - -class ModelTest(TestCase): - fixtures = ['arches.json', 'repos.json', 'test_packages.json'] - - def setUp(self): - self.user = User(id=1,username='tester',first_name='test', - last_name='user', password='testuser', - is_active=True, is_staff=True) - self.user.save() - self.orphan = User(id=0,first_name='Orphans') - pass - - def testPackageGetDepends(self): - """ - Test the Package object's get_depends() method - """ - p = Package.objects.get(pkgname='abs',arch__name__iexact='i686') - dep1 = {'dep': PackageDepend.objects.get(id=1), - 'pkg': Package.objects.get(id=7)} - dep2 = {'dep': PackageDepend.objects.get(id=2), 'pkg': None} - expected = [dep1, dep2] - results = p.get_depends() - self.failUnlessEqual(results, expected) - del p - - def testPackageGetRequiredBy(self): - """ - Test the Package object's get_requiredby() method - """ - p = Package.objects.get(pkgname='iproute',arch__name__iexact='i686') - expected = [Package.objects.get(id=123),Package.objects.get(id=163)] - results = p.get_requiredby() - self.failUnlessEqual(results, expected) - del p - - def testGetFlagStats(self): - """ - Test the PackageManager get_flag_stats method - """ - results = Package.objects.get_flag_stats() - expected = [(self.orphan, 0L, 0L),(self.user, 346L, 0L)] - self.failUnlessEqual(results, expected) - del results - - -- cgit v1.2.3-2-g168b