Changeset 1234 in main


Ignore:
Timestamp:
06/19/12 15:52:32 (7 years ago)
Author:
zali
Message:

Update tests on cancel features

Location:
trunk/openPLM/plmapp/tests/controllers
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/openPLM/plmapp/tests/controllers/document.py

    r1232 r1234  
    344344        res = super(DocumentControllerTest, self).assertCancelError(ctrl) 
    345345        res = res or bool(ctrl.get_attached_parts()) 
    346         res = res or models.DocumentFile.objects.filter(document=self.object).exists() 
     346        res = res or models.DocumentFile.objects.filter(document=ctrl.object).exists() 
    347347        self.assertTrue(res) 
    348348         
    349     def test_cancel_linked_document(self): 
     349    def test_cancel_has_part_related(self): 
     350        """ Tests that a document linked to a part can *not* be cancelled. """ 
    350351        part = self.get_part() 
    351352        self.controller.attach_to_part(part) 
    352353        self.assertEqual(1, self.controller.get_attached_parts().count()) 
    353354        self.assertCancelError(self.controller) 
     355         
     356    def test_cancel_has_file_related(self): 
     357        """ Tests that a document with at least one file can *not* be cancelled. """ 
     358        f = self.get_file() 
     359        self.controller.add_file(f) 
     360        files = self.controller.files.all() 
     361        self.assertEqual(len(files), 1) 
     362        self.assertCancelError(self.controller) 
  • trunk/openPLM/plmapp/tests/controllers/part.py

    r1233 r1234  
    877877        self.assertTrue(res) 
    878878         
    879     def test_cancel_child(self) : 
    880         """ Test that a child (part) can *not* be cancelled. """ 
     879    def test_cancel_has_parent(self) : 
     880        """ Test that a part with at least one parent can *not* be cancelled. """ 
    881881        self.controller.add_child(self.controller3, 10, 15, "m") 
    882882        children = self.controller.get_children() 
     
    884884        self.assertCancelError(self.controller3) 
    885885     
    886     def test_cancel_parent(self) : 
    887         """ Tests that a parent (part) can *not* be cancelled. """ 
     886    def test_cancel_has_child(self) : 
     887        """ Tests that a part with at least one child can *not* be cancelled. """ 
    888888        self.controller3.add_child(self.controller2, 10, 15, "m") 
    889889        children = self.controller3.get_children() 
Note: See TracChangeset for help on using the changeset viewer.