Exemplo n.º 1
0
 def test_numeric_ok(self):
     """Test a working numeric descriptor."""
     desc = NumMolDescriptor(heading='heading',
                             name='test descriptor',
                             calculatorSoftware='test_suite',
                             calculatorSoftwareVersion=0,
                             maximum=5,
                             minimum=3)
     desc.save()
     desc.delete()
Exemplo n.º 2
0
 def test_numeric_lims_null(self):
     """Test creating a numeric descriptor w/a null min, max value works."""
     desc = NumMolDescriptor(heading='heading',
                             name='test descriptor',
                             calculatorSoftware='test_suite',
                             calculatorSoftwareVersion=0,
                             maximum=None,
                             minimum=None)
     desc.save()
     desc.delete()
Exemplo n.º 3
0
 def test_numeric_max_null(self):
     """Test creating a numeric descriptor with a null max value works."""
     desc = NumMolDescriptor(
         heading='heading',
         name='test descriptor',
         calculatorSoftware = 'test_suite',
         calculatorSoftwareVersion=0,
         maximum=None,
         minimum=3)
     desc.save()
     desc.delete()
Exemplo n.º 4
0
 def test_numeric_ok(self):
     """Test a working numeric descriptor."""
     desc = NumMolDescriptor(
         heading='heading',
         name='test descriptor',
         calculatorSoftware = 'test_suite',
         calculatorSoftwareVersion=0,
         maximum=5,
         minimum=3)
     desc.save()
     desc.delete()
Exemplo n.º 5
0
 def test_numeric_min_null(self):
     """Test creating a numeric descriptor with a null min value works."""
     desc = NumMolDescriptor(heading='heading',
                             name='test descriptor',
                             calculatorSoftware='test_suite',
                             calculatorSoftwareVersion=0,
                             maximum=5,
                             minimum=None)
     desc.save()
     descVal = NumMolDescriptorValue(
         compound=CompoundGuideEntry.objects.get(
             abbrev='EtOH', labGroup__title='Narnia').compound,
         descriptor=desc,
         value=3)
     descVal.save()
     desc.delete()
Exemplo n.º 6
0
 def test_numeric_min_null(self):
     """Test creating a numeric descriptor with a null min value works."""
     desc = NumMolDescriptor(
         heading='heading',
         name='test descriptor',
         calculatorSoftware = 'test_suite',
         calculatorSoftwareVersion=0,
         maximum=5,
         minimum=None)
     desc.save()
     descVal = NumMolDescriptorValue(
         compound=Compound.objects.get(abbrev='EtOH'),
         descriptor=desc,
         value=3)
     descVal.save()
     desc.delete()
Exemplo n.º 7
0
 def test_numeric_max_null_toolow(self):
     """Test creating a numeric descriptor with a null max value works."""
     desc = NumMolDescriptor(heading='heading',
                             name='test descriptor',
                             calculatorSoftware='test_suite',
                             calculatorSoftwareVersion=0,
                             maximum=None,
                             minimum=3)
     desc.save()
     with self.assertRaises(ValidationError):
         descVal = NumMolDescriptorValue(
             compound=CompoundGuideEntry.objects.get(
                 abbrev='EtOH', labGroup__title='Narnia').compound,
             descriptor=desc,
             value=2)
         descVal.save()
     desc.delete()
Exemplo n.º 8
0
 def test_numeric_toohigh(self):
     """Test a descriptor value that is above the maximum."""
     desc = NumMolDescriptor(heading='heading',
                             name='test descriptor',
                             calculatorSoftware='test_suite',
                             calculatorSoftwareVersion=0,
                             maximum=5,
                             minimum=3)
     desc.save()
     with self.assertRaises(ValidationError):
         descVal = NumMolDescriptorValue(
             compound=CompoundGuideEntry.objects.get(
                 abbrev='EtOH', labGroup__title='Narnia').compound,
             descriptor=desc,
             value=6)
         descVal.save()
     desc.delete()
Exemplo n.º 9
0
 def test_numeric_max_null_toohigh(self):
     """Test creating a numeric descriptor with a null max value works."""
     desc = NumMolDescriptor(
         heading='heading',
         name='test descriptor',
         calculatorSoftware = 'test_suite',
         calculatorSoftwareVersion=0,
         maximum=5,
         minimum=None)
     desc.save()
     with self.assertRaises(ValidationError):
         descVal = NumMolDescriptorValue(
             compound=Compound.objects.get(abbrev='EtOH'),
             descriptor=desc,
             value=6)
         descVal.save()
     desc.delete()
Exemplo n.º 10
0
 def test_numeric_loolow(self):
     """Test a descriptor value that is below the minimum."""
     desc = NumMolDescriptor(
         heading='heading',
         name='test descriptor',
         calculatorSoftware = 'test_suite',
         calculatorSoftwareVersion=0,
         maximum=5,
         minimum=3)
     desc.save()
     with self.assertRaises(ValidationError):
         descVal = NumMolDescriptorValue(
             compound=Compound.objects.get(abbrev='EtOH'),
             descriptor=desc,
             value=2)
         descVal.save()
     desc.delete()
Exemplo n.º 11
0
 def test_numeric_ok(self):
     """Test a working numeric descriptor."""
     desc = NumMolDescriptor(
         heading='heading',
         name='test descriptor',
         calculatorSoftware = 'test_suite',
         calculatorSoftwareVersion=0,
         maximum=5,
         minimum=3)
     desc.save()
     descVal = NumMolDescriptorValue(
         compound=Compound.objects.get(abbrev='EtOH'),
         descriptor=desc,
         value=3)
     descVal.save()
     descVal.delete()
     desc.delete()