summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2012-12-30 13:31:08 +0800
committerJeremy Kerr <jk@ozlabs.org>2012-12-30 13:59:52 +0800
commitd0fca5754590a0322b27152269a1f9bc71690bf7 (patch)
tree74a22850ca6a82298a6ca076350d3b513ed5caa3 /apps
parentaa09aee4fc1114a53ef4abe82ced0a725faf512c (diff)
downloadpatchwork-d0fca5754590a0322b27152269a1f9bc71690bf7.tar.bz2
patchwork-d0fca5754590a0322b27152269a1f9bc71690bf7.tar.xz
tests/bundle: Check for form errors during bundle updates
Add a check for patchform errors during bundle update operations, both when logged in as a maintainer and a regular user. This exposes a problem with the maintainer patchform: we see an unexpected form error with the state input. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'apps')
-rw-r--r--apps/patchwork/tests/bundles.py23
1 files changed, 23 insertions, 0 deletions
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):