def test_get_all_completed_procedures_for_patient(self): testAssign, testPatient, testProcedure = self.test_create_assignedProcedure( ) actual_return = AssignedProcedures.get_all_procedures_completed_by_patient( testPatient) self.assertListEqual(actual_return, []) testAssign.completed = True testAssign.save() actual_return = AssignedProcedures.get_all_procedures_completed_by_patient( testPatient) self.assertListEqual(actual_return, [testAssign])
def patient_is_done(self): from assigned_procedures.models import AssignedProcedures if (not AssignedProcedures.get_all_active_procedures_for_patient(self) ) and (AssignedProcedures.get_all_procedures_completed_by_patient( self)): # This patient has been assigned procedures and has completed them all return True else: return False