From d42d047b4cd0dd9da7874d6fb962dd5511f3b0e3 Mon Sep 17 00:00:00 2001 From: Xavier Vello Date: Thu, 2 May 2024 11:57:44 +0200 Subject: [PATCH] don't compare sent_at if null --- capture/tests/django_compat.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/capture/tests/django_compat.rs b/capture/tests/django_compat.rs index d1d313c..cd419c2 100644 --- a/capture/tests/django_compat.rs +++ b/capture/tests/django_compat.rs @@ -201,6 +201,11 @@ async fn it_matches_django_capture_behaviour() -> anyhow::Result<()> { if let Some(object) = expected.as_object_mut() { // site_url is unused in the pipeline now, let's drop it object.remove("site_url"); + + // Remove sent_at field if empty: Rust will skip marshalling it + if let Some(None) = object.get("sent_at").map(|v| v.as_str()) { + object.remove("sent_at"); + } } let match_config = assert_json_diff::Config::new(assert_json_diff::CompareMode::Strict); @@ -209,7 +214,7 @@ async fn it_matches_django_capture_behaviour() -> anyhow::Result<()> { { println!( "record mismatch at line {}, event {}: {}", - line_number, event_number, e + line_number+1, event_number, e ); mismatches += 1; }