Changeset 824 in main


Ignore:
Timestamp:
03/02/12 14:03:19 (10 years ago)
Author:
agalech
Message:

DocumentFile?.lock now raises LockError? Instead of ValueError? when checkout_valide is False

Location:
trunk/openPLM/plmapp
Files:
2 edited

Legend:

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

    r818 r824  
    9191            raise ValueError("Bad file's document") 
    9292        if not doc_file.checkout_valid: 
    93             raise ValueError("Check-out impossible, native related file is locked")  
     93            raise LockError("Check-out impossible, native related file is locked")  
    9494        if not doc_file.locked: 
    9595            doc_file.locked = True 
  • trunk/openPLM/plmapp/tests/gestion_document_native.py

    r810 r824  
    11 
    22from openPLM.plmapp.controllers.document import DocumentController 
     3from openPLM.plmapp.exceptions import LockError 
    34from openPLM.plmapp.tests.base import BaseTestCase 
    4  
    5  
    65class DocNativeTestCase(BaseTestCase): 
    76 
     
    3736 
    3837        self.document.lock(native) 
    39         self.assertRaises(ValueError, self.document.lock, standar) 
     38        self.assertRaises(LockError, self.document.lock, standar) 
    4039        self.assertEqual(native.locked, True) 
    4140        self.assertFalse(standar.locked) 
Note: See TracChangeset for help on using the changeset viewer.