Exemplo n.º 1
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()
Exemplo n.º 2
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()
Exemplo n.º 3
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()
Exemplo n.º 4
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=Compound.objects.get(abbrev='EtOH'),
             descriptor=desc,
             value=2)
         descVal.save()
     desc.delete()
Exemplo n.º 5
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=Compound.objects.get(abbrev='EtOH'),
         descriptor=desc,
         value=3)
     descVal.save()
     descVal.delete()
     desc.delete()
Exemplo n.º 6
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()
Exemplo n.º 7
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()
Exemplo n.º 8
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()