示例#1
0
 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)
示例#2
0
 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)
示例#3
0
 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))
示例#4
0
 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))
示例#5
0
 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])
示例#6
0
 def test_aliquot_type_repr(self):
     aliquot_type = AliquotType(name="aliquot",
                                numeric_code="00",
                                alpha_code="AA")
     self.assertTrue(repr(aliquot_type))
示例#7
0
 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)