def test_primary_aliquot_exists2(self): """Asserts primary aliquot exists using requisition_identifier.""" aliquot_type = AliquotType(name="aliquot_a", numeric_code="22", alpha_code="WW") primary_aliquot = PrimaryAliquot( requisition_identifier="ABCDE", identifier_prefix="066ABCDE", aliquot_type=aliquot_type, aliquot_creator_cls=MyAliquotCreator, ) obj = primary_aliquot.object p = PrimaryAliquot( requisition_identifier=obj.requisition_identifier, aliquot_creator_cls=MyAliquotCreator, ) self.assertEqual(obj.aliquot_identifier, p.object.aliquot_identifier)
def test_get_primary_aliquot(self): """Asserts does not recreate aliquot model instance if already exists. """ aliquot_type = AliquotType(name="aliquot_a", numeric_code="22", alpha_code="WW") p = PrimaryAliquot( requisition_identifier="ABCDE", identifier_prefix="066ABCDE", aliquot_type=aliquot_type, aliquot_creator_cls=MyAliquotCreator, ) pk = p.object.id aliquot_identifier = p.object.aliquot_identifier p = PrimaryAliquot( requisition_identifier="ABCDE", identifier_prefix="066ABCDE", aliquot_type=aliquot_type, aliquot_creator_cls=MyAliquotCreator, ) self.assertEqual(aliquot_identifier, p.object.aliquot_identifier) self.assertEqual(pk, p.object.id)
def test_process_profile_repr(self): a = AliquotType(name="aliquot_a", numeric_code="55", alpha_code="AA") processing_profile = ProcessingProfile(name="processing_profile", aliquot_type=a) self.assertTrue(repr(processing_profile))
def test_process_repr(self): a = AliquotType(name="aliquot_a", numeric_code="55", alpha_code="AA") process = Process(aliquot_type=a) self.assertTrue(repr(process))
def test_aliquot_type_derivatives_multi(self): """Asserts can add more than one derivative.""" pl = AliquotType(name="plasma", numeric_code="32", alpha_code="PL") self.wb.add_derivatives(self.bc, pl) self.assertEqual(self.wb.derivatives, [self.bc, pl])
def test_aliquot_type_repr(self): aliquot_type = AliquotType(name="aliquot", numeric_code="00", alpha_code="AA") self.assertTrue(repr(aliquot_type))
def test_requisition_panel(self): a = AliquotType(name="aliquot_a", numeric_code="55", alpha_code="AA") processing_profile = ProcessingProfile(name="process", aliquot_type=a) RequisitionPanel(name="Viral Load", processing_profile=processing_profile)