Commit fb60b3f6 authored by Jeremy Kerr's avatar Jeremy Kerr
Browse files

tests/updates: Add delegate clear test

Signed-off-by: default avatarJeremy Kerr <>
parent c24e22bb
......@@ -69,17 +69,17 @@ class MultipleUpdateTest(TestCase):
self.assertEquals( \
[Patch.objects.get(pk = for p in self.patches],
['The submitted form data was invalid'])
self.assertFormError(response, 'patchform', 'state',
'Select a valid choice. That choice is not one ' + \
'of the available choices.')
def testDelegateChange(self):
delegate = create_maintainer(defaults.project)
def _testDelegateChange(self, delegate_str):
data = {'action': 'Update',
'project': str(,
'form': 'patchlistform',
'archived': '*',
'state': '*',
'delegate': str(,
'delegate': delegate_str
for patch in self.patches:
data['patch_id:%d' %] = 'checked'
......@@ -88,9 +88,19 @@ class MultipleUpdateTest(TestCase):
args = [defaults.project.linkname])
response =, data)
self.failUnlessEqual(response.status_code, 200)
return response
def testDelegateChangeValid(self):
delegate = create_maintainer(defaults.project)
response = self._testDelegateChange(str(
for patch in [Patch.objects.get(pk = for p in self.patches]:
self.assertEquals(patch.delegate, delegate)
def testDelegateClear(self):
response = self._testDelegateChange('')
for patch in [Patch.objects.get(pk = for p in self.patches]:
self.assertEquals(patch.delegate, None)
def tearDown(self):
for p in self.patches:
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment