예제 #1
0
 def test_ordinal_ok(self):
     """Test a working ordinal descriptor."""
     desc = OrdMolDescriptor(heading='heading',
                             name='test descriptor',
                             calculatorSoftware='test_suite',
                             calculatorSoftwareVersion=0,
                             maximum=5,
                             minimum=3)
     desc.save()
     desc.delete()
예제 #2
0
 def test_ordinal(self):
     """Test ordinal descriptors."""
     with self.assertRaises(ValidationError):
         desc = OrdMolDescriptor(heading='heading',
                                 name='test descriptor',
                                 calculatorSoftware='test_suite',
                                 calculatorSoftwareVersion=0,
                                 maximum=3,
                                 minimum=5)
         desc.save()
예제 #3
0
 def test_ordinal_loolow(self):
     """Test a descriptor value that is below the minimum."""
     desc = OrdMolDescriptor(heading='heading',
                             name='test descriptor',
                             calculatorSoftware='test_suite',
                             calculatorSoftwareVersion=0,
                             maximum=5,
                             minimum=3)
     desc.save()
     with self.assertRaises(ValidationError):
         descVal = OrdMolDescriptorValue(
             compound=CompoundGuideEntry.objects.get(
                 abbrev='EtOH', labGroup__title='Narnia').compound,
             descriptor=desc,
             value=2)
         descVal.save()
     desc.delete()
예제 #4
0
 def test_ordinal_ok(self):
     """Test a working ordinal descriptor."""
     desc = OrdMolDescriptor(heading='heading',
                             name='test descriptor',
                             calculatorSoftware='test_suite',
                             calculatorSoftwareVersion=0,
                             maximum=5,
                             minimum=3)
     desc.save()
     descVal = OrdMolDescriptorValue(
         compound=CompoundGuideEntry.objects.get(
             abbrev='EtOH', labGroup__title='Narnia').compound,
         descriptor=desc,
         value=3)
     descVal.save()
     descVal.delete()
     desc.delete()