iso_date_time

Function iso_date_time 

Source
pub fn iso_date_time() -> ExpectIsoDateTime
Expand description

Expect a valid-looking ISO date time.

Further methods are available on the returned ExpectIsoDateTime to check if the time is within certain durations, the time zone, etc.

use axum_test::expect_json;
use std::time::Duration;

let server = TestServer::new(Router::new())?;

server.get(&"/user/barrington")
    .await
    .assert_json(&json!({
        "name": "Barrington",
        "created_at": expect_json::iso_date_time(),
    }));