summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorDusty Phillips <buchuki@gmail.com>2008-10-07 11:23:23 -0400
committerDusty Phillips <buchuki@gmail.com>2008-10-07 11:23:23 -0400
commit3d4775486e0c32cccfb0c5a480f8b629aaf60e5a (patch)
tree2a73f88080d6d2ff1be71fa9f3eab9af588d1603 /main
parent53a4f63094e903f89bed84b90c5c69af1f7e5d2f (diff)
these tests will be broken and should have some real tests written later
Diffstat (limited to 'main')
-rw-r--r--main/tests.py49
1 files changed, 0 insertions, 49 deletions
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
-
-