예제 #1
0
 def test_numeric(self):
     """Test ordinal descriptors."""
     with self.assertRaises(ValidationError):
         desc = NumMolDescriptor(heading='heading',
                                 name='test descriptor',
                                 calculatorSoftware='test_suite',
                                 calculatorSoftwareVersion=0,
                                 maximum=3,
                                 minimum=5)
         desc.save()
예제 #2
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()
예제 #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()
예제 #4
0
 def test_numeric(self):
     """Test ordinal descriptors."""
     with self.assertRaises(ValidationError):
         desc = NumMolDescriptor(
             heading='heading',
             name='test descriptor',
             calculatorSoftware = 'test_suite',
             calculatorSoftwareVersion=0,
             maximum=3,
             minimum=5)
         desc.save()
예제 #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=Compound.objects.get(abbrev='EtOH'),
         descriptor=desc,
         value=3)
     descVal.save()
     desc.delete()
예제 #6
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()
예제 #7
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()
예제 #8
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()
예제 #9
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()
예제 #10
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()
예제 #11
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()
예제 #12
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()
예제 #13
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()