Esempio n. 1
0
 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)
Esempio n. 2
0
 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)
Esempio n. 3
0
 def test_validate_fields_units(self):
     value_dict = {CONCEPT_A: Value(_make_qty(30), 'valueQuantity')}
     validate_fields([FIELD_MM_HG], value_dict)
Esempio n. 4
0
 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)
Esempio n. 5
0
 def test_validate_fields_not_required(self):
     value_dict = {CONCEPT_A: Value(_make_qty(30), 'valueQuantity')}
     validate_fields([FIELD_NOT_REQUIRED], value_dict)
Esempio n. 6
0
 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)
Esempio n. 7
0
 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)
Esempio n. 8
0
 def test_validate_fieldsrange(self):
     value_dict = {CONCEPT_A: Value(_make_qty(30), 'valueQuantity')}
     validate_fields([FIELD_A], value_dict)