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()
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()
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()
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()
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()
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()
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()
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()
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()
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()
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()
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()
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()