You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bloodhound.apache.org by rj...@apache.org on 2014/01/23 10:06:16 UTC
svn commit: r1560613 -
/bloodhound/trunk/bloodhound_relations/bhrelations/tests/api.py
Author: rjollos
Date: Thu Jan 23 09:06:16 2014
New Revision: 1560613
URL: http://svn.apache.org/r1560613
Log:
0.8dev: Fixed error in unit test revealed by [1560601]. Refs #742.
The parent ticket should not have status //closed// since the //resolve// action is being invoked on it. This error was revealed after [1560601] since we are now looking up operations for the //action//, which depends on ticket status. With the default workflow, //leave// and //del_resolution// will be the only operations for a closed ticket.
Modified:
bloodhound/trunk/bloodhound_relations/bhrelations/tests/api.py
Modified: bloodhound/trunk/bloodhound_relations/bhrelations/tests/api.py
URL: http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_relations/bhrelations/tests/api.py?rev=1560613&r1=1560612&r2=1560613&view=diff
==============================================================================
--- bloodhound/trunk/bloodhound_relations/bhrelations/tests/api.py (original)
+++ bloodhound/trunk/bloodhound_relations/bhrelations/tests/api.py Thu Jan 23 09:06:16 2014
@@ -449,17 +449,20 @@ class ApiTestCase(BaseRelationsTestCase)
self.fail("Could not add valid relation.")
def test_cannot_close_ticket_with_open_children(self):
- t1 = self._insert_and_load_ticket("1", status='closed')
- t2 = self._insert_and_load_ticket("2", status='closed')
- t3 = self._insert_and_load_ticket("3")
+ t1 = self._insert_and_load_ticket("1") # t1
+ t2 = self._insert_and_load_ticket("2", status='closed') # / | \
+ t3 = self._insert_and_load_ticket("3") # t2 t3 t4
+ t4 = self._insert_and_load_ticket("4")
self.relations_system.add(t2, t1, "parent")
self.relations_system.add(t3, t1, "parent")
+ self.relations_system.add(t4, t1, "parent")
+ # A warning is be returned for each open ticket
self.req.args["action"] = 'resolve'
- warnings = TicketRelationsSpecifics(self.env).validate_ticket(
- self.req, t1)
- #assert
- self.assertEqual(1, len(list(warnings)))
+ warnings = \
+ TicketRelationsSpecifics(self.env).validate_ticket(self.req, t1)
+
+ self.assertEqual(2, len(list(warnings)))
def test_duplicate_can_only_reference_older_ticket(self):
t1 = self._insert_and_load_ticket("1")