forked from kiwitcms/Kiwi
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor updateAssignee to use JSON-RPC. Refs kiwitcms#1063
Remove unused imports Refactor update of assignee rpc call Remove override of assignee form field Remove trimming Fix tests for changeAssignee Revert change in test case for updateAssignee with invalid id Add tests for updateAssignee
- Loading branch information
Showing
5 changed files
with
35 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -291,14 +291,40 @@ def test_update_with_single_caserun(self): | |
self.assertEqual(tcr['status'], self.status_positive.name) | ||
self.assertEqual(tcr['sortkey'], 90) | ||
|
||
def test_update_with_assignee_id(self): | ||
tcr = self.rpc_client.TestExecution.update(self.case_run_1.pk, { | ||
"assignee": self.user.pk | ||
}) | ||
self.assertEqual(tcr['assignee'], self.user.username) | ||
|
||
def test_update_with_assignee_email(self): | ||
tcr = self.rpc_client.TestExecution.update(self.case_run_1.pk, { | ||
"assignee": self.user.email | ||
}) | ||
self.assertEqual(tcr['assignee'], self.user.username) | ||
|
||
def test_update_with_assignee_username(self): | ||
tcr = self.rpc_client.TestExecution.update(self.case_run_1.pk, { | ||
"assignee": self.user.username | ||
}) | ||
self.assertEqual(tcr['assignee'], self.user.username) | ||
|
||
def test_update_with_non_existing_build(self): | ||
with self.assertRaisesRegex(XmlRPCFault, 'Select a valid choice'): | ||
self.rpc_client.TestExecution.update(self.case_run_1.pk, {"build": 1111111}) | ||
|
||
def test_update_with_non_existing_assignee(self): | ||
with self.assertRaisesRegex(XmlRPCFault, 'Select a valid choice'): | ||
def test_update_with_non_existing_assignee_id(self): | ||
with self.assertRaisesRegex(XmlRPCFault, 'Unknown user_id'): | ||
self.rpc_client.TestExecution.update(self.case_run_1.pk, {"assignee": 1111111}) | ||
|
||
def test_update_with_non_existing_assignee_email(self): | ||
with self.assertRaisesRegex(XmlRPCFault, 'Unknown user'): | ||
self.rpc_client.TestExecution.update(self.case_run_1.pk, {"assignee": '[email protected]'}) | ||
|
||
def test_update_with_non_existing_assignee_username(self): | ||
with self.assertRaisesRegex(XmlRPCFault, 'Unknown user:'): | ||
self.rpc_client.TestExecution.update(self.case_run_1.pk, {"assignee": 'nonExistentUsername'}) | ||
|
||
def test_update_with_non_existing_status(self): | ||
with self.assertRaisesRegex(XmlRPCFault, 'Select a valid choice'): | ||
self.rpc_client.TestExecution.update(self.case_run_1.pk, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters