Ejemplo n.º 1
0
 def test_get_records_created_in_date_range_invalid_format(self):
     r = RESTQuery()
     r.query_table_is("ticket")
     with pytest.raises(AssertionError) as e:
         r.get_records_created_in_date_range("1970-01-01", "2012-12-12")
     assert "Input date arguments were not provided in the correct format. Verify that they are in the format YYYY-MM-DD hh:mm:ss." in str(
         e)
     with pytest.raises(AssertionError) as e:
         r.get_records_created_in_date_range("Michael Rules", "2012-12-12")
     assert "Input date arguments were not provided in the correct format. Verify that they are in the format YYYY-MM-DD hh:mm:ss." in str(
         e)
Ejemplo n.º 2
0
 def test_required_query_parameter_is_date_field(self):
     r = RESTQuery()
     r.query_table_is("incident")
     try:
         r.required_query_parameter_is("sys_created_on",
                                       "BETWEEN",
                                       "2016-05-02 09:45:01",
                                       "2016-05-09 09:45:01",
                                       is_date_field=True)
         r.add_query_parameter("OR", "sys_updated_on", "EQUALS",
                               "2018-08-10 10:23:40")
     except AssertionError:
         pytest.fail(
             "Unexpected AssertionError raised when setting date field query parameter."
         )