]> git.decadent.org.uk Git - dak.git/commitdiff
Test the backrefs of class Override.
authorTorsten Werner <twerner@debian.org>
Sat, 19 Feb 2011 13:07:17 +0000 (14:07 +0100)
committerTorsten Werner <twerner@debian.org>
Sat, 19 Feb 2011 13:07:17 +0000 (14:07 +0100)
Signed-off-by: Torsten Werner <twerner@debian.org>
tests/dbtest_contents.py

index 99b8a73925300a6d1dd7b4c502e586a3fff9eeb7..f7be2f268fb66fc26dc4764b9eed6a13c590d65c 100755 (executable)
@@ -120,6 +120,14 @@ class ContentsTestCase(DBDakTestCase):
         self.assertEqual(2, len(list))
         self.assertTrue(self.override['hello_sid_main_udeb'] not in list)
         self.assertTrue(self.override['hello_squeeze_main_deb'] in list)
+        # test the backrefs
+        self.assertEqual(self.override['hello_sid_main_udeb'], \
+            self.suite['sid'].overrides.one())
+        self.assertEqual(2, self.comp['main'].overrides.count())
+        self.assertEqual(self.override['hello_sid_main_udeb'], \
+            self.comp['main'].overrides.filter_by(suite = self.suite['sid']).one())
+        self.assertEqual(self.override['hello_sid_main_udeb'], \
+            self.otype['udeb'].overrides.one())
 
 if __name__ == '__main__':
     unittest.main()