From: Torsten Werner Date: Sat, 19 Feb 2011 13:07:17 +0000 (+0100) Subject: Test the backrefs of class Override. X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=f360a445cf2ada34e501c9fff8e71a5cb6524828;p=dak.git Test the backrefs of class Override. Signed-off-by: Torsten Werner --- diff --git a/tests/dbtest_contents.py b/tests/dbtest_contents.py index 99b8a739..f7be2f26 100755 --- a/tests/dbtest_contents.py +++ b/tests/dbtest_contents.py @@ -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()