summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDusty Phillips <buchuki@gmail.com>2008-10-07 17:23:23 +0200
committerDusty Phillips <buchuki@gmail.com>2008-10-07 17:23:23 +0200
commit3d4775486e0c32cccfb0c5a480f8b629aaf60e5a (patch)
tree2a73f88080d6d2ff1be71fa9f3eab9af588d1603
parent53a4f63094e903f89bed84b90c5c69af1f7e5d2f (diff)
downloadarchweb-3d4775486e0c32cccfb0c5a480f8b629aaf60e5a.tar.gz
archweb-3d4775486e0c32cccfb0c5a480f8b629aaf60e5a.tar.xz
these tests will be broken and should have some real tests written later
-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 543a0c1..0000000
--- 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
-
-