def test_validate_fields_not_lessthan(self): value_dict = { CONCEPT_A: Value(_make_qty(30), 'valueQuantity'), CONCEPT_B: Value(_make_qty(30), 'valueQuantity'), } with self.assertRaises(BadRequest): validate_fields([FIELD_LESSTHAN], value_dict)
def test_validate_fields_wrong_units(self): value_dict = {CONCEPT_A: Value(_make_qty(30), 'valueQuantity')} with self.assertRaises(BadRequest): validate_fields([FIELD_KG], value_dict)
def test_validate_fields_units(self): value_dict = {CONCEPT_A: Value(_make_qty(30), 'valueQuantity')} validate_fields([FIELD_MM_HG], value_dict)
def test_validate_fields_lessthan(self): value_dict = { CONCEPT_A: Value(_make_qty(30), 'valueQuantity'), CONCEPT_B: Value(_make_qty(20), 'valueQuantity'), } validate_fields([FIELD_LESSTHAN], value_dict)
def test_validate_fields_not_required(self): value_dict = {CONCEPT_A: Value(_make_qty(30), 'valueQuantity')} validate_fields([FIELD_NOT_REQUIRED], value_dict)
def test_validate_fields_required(self): value_dict = {CONCEPT_A: Value(_make_qty(30), 'valueQuantity')} with self.assertRaises(BadRequest): validate_fields([FIELD_REQUIRED], value_dict)
def test_validate_fields_outside_range_high(self): value_dict = {CONCEPT_A: Value(_make_qty(300), 'valueQuantity')} with self.assertRaises(BadRequest): validate_fields([FIELD_A], value_dict)
def test_validate_fieldsrange(self): value_dict = {CONCEPT_A: Value(_make_qty(30), 'valueQuantity')} validate_fields([FIELD_A], value_dict)