X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=apps%2Fpatchwork%2Ftests%2Fbundles.py;h=00a2323f79fe02ded4d44d10fea15f075cdc8925;hb=d0fca5754590a0322b27152269a1f9bc71690bf7;hp=0404576e905c82555a9664d247def6834bfbecfe;hpb=aa09aee4fc1114a53ef4abe82ced0a725faf512c;p=patchwork diff --git a/apps/patchwork/tests/bundles.py b/apps/patchwork/tests/bundles.py index 0404576..00a2323 100644 --- a/apps/patchwork/tests/bundles.py +++ b/apps/patchwork/tests/bundles.py @@ -127,6 +127,15 @@ class BundleUpdateTest(BundleTestBase): super(BundleUpdateTest, self).setUp() self.newname = 'newbundlename' + def checkPatchformErrors(self, response): + formname = 'patchform' + if not formname in response.context: + return + form = response.context[formname] + if not form: + return + self.assertEquals(form.errors, {}) + def publicString(self, public): if public: return 'on' @@ -159,6 +168,9 @@ class BundleUpdateTest(BundleTestBase): self.assertEqual(bundle.name, newname) self.assertEqual(bundle.public, self.bundle.public) + # check other forms for errors + self.checkPatchformErrors(response) + def testUpdatePublic(self): newname = 'newbundlename' data = { @@ -173,6 +185,17 @@ class BundleUpdateTest(BundleTestBase): self.assertEqual(bundle.name, self.bundle.name) self.assertEqual(bundle.public, not self.bundle.public) + # check other forms for errors + self.checkPatchformErrors(response) + +class BundleMaintainerUpdateTest(BundleUpdateTest): + + def setUp(self): + super(BundleMaintainerUpdateTest, self).setUp() + profile = self.user.get_profile() + profile.maintainer_projects.add(defaults.project) + profile.save() + class BundlePublicViewTest(BundleTestBase): def setUp(self):